From c7492eb08e2c7acd69c8e0128c43c9f68faaba63 Mon Sep 17 00:00:00 2001 From: aB0t Date: Sat, 27 Jan 2024 09:09:33 +0200 Subject: [PATCH] update 2024-01-27 --- README.md | 87 +- .../README.md | 10 +- .../code.php | 42 +- .../code.power | 39 +- .../settings.json | 2 +- .../code.php | 18 +- .../code.power | 18 +- .../README.md | 3 +- .../code.php | 8 +- .../code.power | 8 +- .../code.php | 23 +- .../code.power | 23 +- .../README.md | 3 +- .../code.php | 17 +- .../code.power | 17 +- .../code.php | 38 +- .../code.power | 38 +- .../README.md | 31 + .../code.php | 34 + .../code.power | 7 + .../settings.json | 20 + .../README.md | 65 + .../code.php | 634 ++++ .../code.power | 600 ++++ .../settings.json | 55 + .../README.md | 4 +- .../code.php | 9 +- .../code.power | 9 +- .../README.md | 74 + .../code.php | 709 ++++ .../code.power | 667 ++++ .../settings.json | 87 + .../code.php | 20 +- .../code.power | 20 +- .../README.md | 52 + .../code.php | 345 ++ .../code.power | 312 ++ .../settings.json | 49 + .../README.md | 6 +- .../code.php | 15 +- .../code.power | 15 +- .../README.md | 14 +- .../code.php | 21 +- .../code.power | 21 +- .../code.php | 8 +- .../code.power | 8 +- .../README.md | 94 + .../code.php | 643 ++++ .../code.power | 604 ++++ .../settings.json | 73 + .../README.md | 14 +- .../code.php | 103 +- .../code.power | 98 +- .../settings.json | 8 +- .../README.md | 30 + .../code.php | 27 + .../code.power | 1 + .../settings.json | 20 + .../README.md | 53 + .../code.php | 142 + .../code.power | 109 + .../settings.json | 51 + .../README.md | 77 + .../code.php | 388 +++ .../code.power | 340 ++ .../settings.json | 111 + .../README.md | 2 +- .../code.php | 2 +- .../code.power | 2 +- .../README.md | 46 + .../code.php | 91 + .../code.power | 61 + .../settings.json | 37 + .../README.md | 109 + .../code.php | 213 ++ .../code.power | 185 + .../settings.json | 27 + .../README.md | 18 +- .../code.php | 83 +- .../code.power | 76 +- .../settings.json | 8 +- .../README.md | 57 + .../code.php | 230 ++ .../code.power | 198 ++ .../settings.json | 37 + .../README.md | 30 + .../code.php | 27 + .../code.power | 1 + .../settings.json | 20 + .../README.md | 46 + .../code.php | 87 + .../code.power | 57 + .../settings.json | 37 + .../README.md | 52 + .../code.php | 339 ++ .../code.power | 306 ++ .../settings.json | 49 + .../README.md | 140 +- .../code.php | 3053 +++++++++-------- .../code.power | 3042 ++++++++-------- .../settings.json | 216 +- .../README.md | 1 - .../code.php | 9 +- .../code.power | 9 +- .../README.md | 56 + .../code.php | 633 ++++ .../code.power | 601 ++++ .../settings.json | 47 + .../code.php | 12 +- .../code.power | 12 +- .../README.md | 62 + .../code.php | 123 + .../code.power | 93 + .../settings.json | 34 + .../README.md | 37 + .../code.php | 63 + .../code.power | 37 + .../settings.json | 23 + .../code.php | 4 +- .../code.power | 4 +- .../README.md | 37 + .../code.php | 33 + .../code.power | 10 + .../settings.json | 18 + .../README.md | 3 +- .../code.php | 20 +- .../code.power | 20 +- .../README.md | 52 + .../code.php | 129 + .../code.power | 98 + .../settings.json | 41 + .../README.md | 54 + .../code.php | 125 + .../code.power | 97 + .../settings.json | 25 + .../README.md | 30 + .../code.php | 34 + .../code.power | 6 + .../settings.json | 25 + .../README.md | 45 + .../code.php | 99 + .../code.power | 71 + .../settings.json | 25 + .../code.php | 5 + .../code.power | 5 + .../README.md | 2 +- .../code.php | 2 +- .../code.power | 2 +- .../README.md | 30 + .../code.php | 34 + .../code.power | 6 + .../settings.json | 25 + .../README.md | 24 +- .../code.php | 20 + .../code.power | 19 + .../settings.json | 18 +- .../README.md | 4 +- .../code.php | 19 +- .../code.power | 18 +- .../settings.json | 100 +- .../README.md | 86 + .../code.php | 177 + .../code.power | 144 + .../settings.json | 46 + .../README.md | 3 +- .../code.php | 9 +- .../code.power | 9 +- .../README.md | 56 + .../code.php | 414 +++ .../code.power | 383 +++ .../settings.json | 43 + .../README.md | 77 + .../code.php | 74 + .../code.power | 51 + .../settings.json | 18 + .../README.md | 37 + .../code.php | 32 + .../code.power | 9 + .../settings.json | 18 + .../README.md | 8 + .../code.php | 20 +- .../code.power | 18 + .../settings.json | 4 + .../README.md | 2 +- .../code.php | 14 +- .../code.power | 8 +- .../settings.json | 8 +- .../README.md | 2 + .../code.php | 60 +- .../code.power | 57 +- .../settings.json | 18 +- .../README.md | 30 + .../code.php | 27 + .../code.power | 1 + .../settings.json | 20 + .../code.php | 2 +- .../settings.json | 4 +- .../README.md | 45 + .../code.php | 80 + .../code.power | 53 + .../settings.json | 27 + .../README.md | 242 +- .../code.php | 1098 ++++-- .../code.power | 1093 ++++-- .../settings.json | 34 +- .../code.php | 4 +- .../code.power | 4 +- .../README.md | 3 +- .../code.php | 9 +- .../code.power | 9 +- .../README.md | 110 +- .../code.php | 371 +- .../code.power | 371 +- .../README.md | 3 +- .../code.php | 8 +- .../code.power | 8 +- .../code.php | 23 +- .../code.power | 23 +- .../README.md | 91 + .../code.php | 555 +++ .../code.power | 517 +++ .../settings.json | 69 + .../README.md | 56 + .../code.php | 367 ++ .../code.power | 335 ++ .../settings.json | 47 + .../README.md | 4 +- .../code.php | 10 +- .../code.power | 10 +- .../README.md | 55 +- .../code.php | 90 +- .../code.power | 85 +- .../settings.json | 20 +- .../README.md | 59 + .../code.php | 141 + .../code.power | 110 + .../settings.json | 43 + .../README.md | 56 + .../code.php | 300 ++ .../code.power | 267 ++ .../settings.json | 49 + .../README.md | 122 +- .../code.php | 335 +- .../code.power | 321 +- .../settings.json | 82 +- .../README.md | 31 + .../code.php | 42 + .../code.power | 14 + .../settings.json | 25 + .../README.md | 37 + .../code.php | 33 + .../code.power | 10 + .../settings.json | 18 + .../README.md | 31 + .../code.php | 42 + .../code.power | 14 + .../settings.json | 25 + .../README.md | 4 +- .../code.php | 7 +- .../code.power | 7 +- .../README.md | 57 + .../code.php | 163 + .../code.power | 131 + .../settings.json | 47 + .../code.php | 32 +- .../code.power | 32 +- .../README.md | 58 + .../code.php | 225 ++ .../code.power | 192 ++ .../settings.json | 51 + .../README.md | 2 +- .../code.php | 5 +- .../code.power | 5 +- .../code.php | 2 +- .../settings.json | 4 +- .../README.md | 6 +- .../code.php | 15 +- .../code.power | 15 +- .../README.md | 8 + .../code.php | 18 +- .../code.power | 16 + .../settings.json | 4 + .../README.md | 8 +- .../code.php | 6 +- .../code.power | 2 +- .../settings.json | 8 +- .../README.md | 86 + .../code.php | 169 + .../code.power | 136 + .../settings.json | 46 + .../README.md | 46 + .../code.php | 108 + .../code.power | 78 + .../settings.json | 37 + .../README.md | 31 + .../code.php | 42 + .../code.power | 14 + .../settings.json | 25 + .../README.md | 23 +- .../code.php | 312 +- .../code.power | 299 +- .../settings.json | 47 +- .../README.md | 54 + .../code.php | 129 + .../code.power | 101 + .../settings.json | 25 + .../README.md | 147 +- .../code.php | 329 +- .../code.power | 312 +- .../settings.json | 36 +- .../README.md | 26 +- .../code.php | 88 +- .../code.power | 76 +- .../settings.json | 28 +- .../README.md | 37 + .../code.php | 32 + .../code.power | 9 + .../settings.json | 18 + .../README.md | 2 +- .../code.php | 13 +- .../code.power | 13 +- .../README.md | 46 + .../code.php | 108 + .../code.power | 78 + .../settings.json | 37 + .../README.md | 29 +- .../code.php | 124 +- .../code.power | 110 +- .../settings.json | 44 +- .../README.md | 3 +- .../code.php | 27 +- .../code.power | 27 +- .../settings.json | 48 +- .../README.md | 51 + .../code.php | 79 + .../code.power | 51 + .../settings.json | 31 + .../code.php | 17 +- .../code.power | 17 +- .../README.md | 86 + .../code.php | 374 ++ .../code.power | 343 ++ .../settings.json | 41 + .../README.md | 57 + .../code.php | 916 +++++ .../code.power | 884 +++++ .../settings.json | 47 + .../code.php | 6 + .../code.power | 3 + .../settings.json | 36 +- .../README.md | 56 + .../code.php | 300 ++ .../code.power | 267 ++ .../settings.json | 49 + .../README.md | 37 + .../code.php | 32 + .../code.power | 9 + .../settings.json | 18 + .../README.md | 37 + .../code.php | 32 + .../code.power | 9 + .../settings.json | 18 + .../README.md | 54 + .../code.php | 130 + .../code.power | 102 + .../settings.json | 25 + .../README.md | 209 ++ .../code.php | 748 ++++ .../code.power | 710 ++++ .../settings.json | 69 + .../README.md | 30 + .../code.php | 34 + .../code.power | 6 + .../settings.json | 25 + .../README.md | 8 + .../code.php | 17 + .../code.power | 16 + .../settings.json | 4 + .../README.md | 4 +- .../code.php | 8 +- .../code.power | 8 +- .../README.md | 3 +- .../code.php | 20 +- .../code.power | 20 +- .../README.md | 3 +- .../code.php | 8 +- .../code.power | 8 +- .../README.md | 52 + .../code.php | 129 + .../code.power | 98 + .../settings.json | 41 + .../README.md | 30 + .../code.php | 27 + .../code.power | 1 + .../settings.json | 20 + .../README.md | 68 +- .../code.php | 90 +- .../code.power | 90 +- .../code.php | 4 +- .../code.power | 4 +- super-powers.json | 619 +++- 401 files changed, 35844 insertions(+), 6076 deletions(-) create mode 100644 src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md create mode 100644 src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php create mode 100644 src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power create mode 100644 src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json create mode 100644 src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md create mode 100644 src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php create mode 100644 src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power create mode 100644 src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json create mode 100644 src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md create mode 100644 src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php create mode 100644 src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power create mode 100644 src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json create mode 100644 src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md create mode 100644 src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php create mode 100644 src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power create mode 100644 src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json create mode 100644 src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md create mode 100644 src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php create mode 100644 src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power create mode 100644 src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json create mode 100644 src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md create mode 100644 src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php create mode 100644 src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power create mode 100644 src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json create mode 100644 src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md create mode 100644 src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php create mode 100644 src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power create mode 100644 src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json create mode 100644 src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md create mode 100644 src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php create mode 100644 src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power create mode 100644 src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json create mode 100644 src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md create mode 100644 src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php create mode 100644 src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power create mode 100644 src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/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/code.power create mode 100644 src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json create mode 100644 src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md create mode 100644 src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php create mode 100644 src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power create mode 100644 src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json create mode 100644 src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md create mode 100644 src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php create mode 100644 src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power create mode 100644 src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json create mode 100644 src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md create mode 100644 src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php create mode 100644 src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power create mode 100644 src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json create mode 100644 src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md create mode 100644 src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php create mode 100644 src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power create mode 100644 src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json create mode 100644 src/31c8127c-0d42-4e09-be81-7cf243c5b30f/README.md create mode 100644 src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php create mode 100644 src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.power create mode 100644 src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json create mode 100644 src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md create mode 100644 src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php create mode 100644 src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power create mode 100644 src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json create mode 100644 src/396f9883-4e50-4b65-a1d5-05bd6c23df30/README.md create mode 100644 src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php create mode 100644 src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.power create mode 100644 src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json create mode 100644 src/3a777d70-52ad-49ec-9016-6f7438608613/README.md create mode 100644 src/3a777d70-52ad-49ec-9016-6f7438608613/code.php create mode 100644 src/3a777d70-52ad-49ec-9016-6f7438608613/code.power create mode 100644 src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json create mode 100644 src/425b1107-933d-4436-87ac-63540ec101c5/README.md create mode 100644 src/425b1107-933d-4436-87ac-63540ec101c5/code.php create mode 100644 src/425b1107-933d-4436-87ac-63540ec101c5/code.power create mode 100644 src/425b1107-933d-4436-87ac-63540ec101c5/settings.json create mode 100644 src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md create mode 100644 src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php create mode 100644 src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.power create mode 100644 src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json create mode 100644 src/44efa649-736d-4656-a0ec-e4f1653a6742/README.md create mode 100644 src/44efa649-736d-4656-a0ec-e4f1653a6742/code.php create mode 100644 src/44efa649-736d-4656-a0ec-e4f1653a6742/code.power create mode 100644 src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json create mode 100644 src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md create mode 100644 src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php create mode 100644 src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power create mode 100644 src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json create mode 100644 src/5133a033-1351-43ec-9692-2907d7b9aacd/README.md create mode 100644 src/5133a033-1351-43ec-9692-2907d7b9aacd/code.php create mode 100644 src/5133a033-1351-43ec-9692-2907d7b9aacd/code.power create mode 100644 src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json create mode 100644 src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md create mode 100644 src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php create mode 100644 src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power create mode 100644 src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json create mode 100644 src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/README.md create mode 100644 src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.php create mode 100644 src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.power create mode 100644 src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json create mode 100644 src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/README.md create mode 100644 src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php create mode 100644 src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.power create mode 100644 src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json create mode 100644 src/600515b1-493f-4448-96fe-018e54e087c8/README.md create mode 100644 src/600515b1-493f-4448-96fe-018e54e087c8/code.php create mode 100644 src/600515b1-493f-4448-96fe-018e54e087c8/code.power create mode 100644 src/600515b1-493f-4448-96fe-018e54e087c8/settings.json create mode 100644 src/6992384f-4f29-489f-a52e-286e03f4593b/README.md create mode 100644 src/6992384f-4f29-489f-a52e-286e03f4593b/code.php create mode 100644 src/6992384f-4f29-489f-a52e-286e03f4593b/code.power create mode 100644 src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json create mode 100644 src/6d179307-b6e5-4f50-962b-5b6360d0759e/README.md create mode 100644 src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.php create mode 100644 src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.power create mode 100644 src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json create mode 100644 src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/README.md create mode 100644 src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php create mode 100644 src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power create mode 100644 src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json create mode 100644 src/84c11075-570a-4907-9be0-9305e0fabe3c/README.md create mode 100644 src/84c11075-570a-4907-9be0-9305e0fabe3c/code.php create mode 100644 src/84c11075-570a-4907-9be0-9305e0fabe3c/code.power create mode 100644 src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json create mode 100644 src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/README.md create mode 100644 src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php create mode 100644 src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.power create mode 100644 src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json create mode 100644 src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/README.md create mode 100644 src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php create mode 100644 src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.power create mode 100644 src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json create mode 100644 src/98419ff3-6628-4539-8365-37f88378bced/README.md create mode 100644 src/98419ff3-6628-4539-8365-37f88378bced/code.php create mode 100644 src/98419ff3-6628-4539-8365-37f88378bced/code.power create mode 100644 src/98419ff3-6628-4539-8365-37f88378bced/settings.json create mode 100644 src/992a842f-1ba9-4a5c-b214-042459ffe038/README.md create mode 100644 src/992a842f-1ba9-4a5c-b214-042459ffe038/code.php create mode 100644 src/992a842f-1ba9-4a5c-b214-042459ffe038/code.power create mode 100644 src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json create mode 100644 src/9b5872d6-c1d8-4602-b443-5844d2c950ee/README.md create mode 100644 src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php create mode 100644 src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.power create mode 100644 src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json create mode 100644 src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/README.md create mode 100644 src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php create mode 100644 src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.power create mode 100644 src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json create mode 100644 src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/README.md create mode 100644 src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php create mode 100644 src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.power create mode 100644 src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json create mode 100644 src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md create mode 100644 src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php create mode 100644 src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power create mode 100644 src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json create mode 100644 src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/README.md create mode 100644 src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php create mode 100644 src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.power create mode 100644 src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json create mode 100644 src/bcf1e767-1566-440d-9f67-5c1bada934fa/README.md create mode 100644 src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php create mode 100644 src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.power create mode 100644 src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json create mode 100644 src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md create mode 100644 src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php create mode 100644 src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.power create mode 100644 src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json create mode 100644 src/c9700450-4f44-4455-bc86-6a7660daadee/README.md create mode 100644 src/c9700450-4f44-4455-bc86-6a7660daadee/code.php create mode 100644 src/c9700450-4f44-4455-bc86-6a7660daadee/code.power create mode 100644 src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json create mode 100644 src/cb2a82a5-aa49-4d46-b765-9b3feb118208/README.md create mode 100644 src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php create mode 100644 src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.power create mode 100644 src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json create mode 100644 src/cfdf0968-f394-4459-933c-ad1674fb1041/README.md create mode 100644 src/cfdf0968-f394-4459-933c-ad1674fb1041/code.php create mode 100644 src/cfdf0968-f394-4459-933c-ad1674fb1041/code.power create mode 100644 src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json create mode 100644 src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md create mode 100644 src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php create mode 100644 src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power create mode 100644 src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json create mode 100644 src/d80e58b8-8462-47c4-9dcd-380445f1c64a/README.md create mode 100644 src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php create mode 100644 src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.power create mode 100644 src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json create mode 100644 src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/README.md create mode 100644 src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php create mode 100644 src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.power create mode 100644 src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json create mode 100644 src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/README.md create mode 100644 src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.php create mode 100644 src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.power create mode 100644 src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json create mode 100644 src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/README.md create mode 100644 src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.php create mode 100644 src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.power create mode 100644 src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json create mode 100644 src/e6683873-b74e-4b54-8466-69f8a9282033/README.md create mode 100644 src/e6683873-b74e-4b54-8466-69f8a9282033/code.php create mode 100644 src/e6683873-b74e-4b54-8466-69f8a9282033/code.power create mode 100644 src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json create mode 100644 src/e7fff971-b031-42bf-8009-ef554e30854d/README.md create mode 100644 src/e7fff971-b031-42bf-8009-ef554e30854d/code.php create mode 100644 src/e7fff971-b031-42bf-8009-ef554e30854d/code.power create mode 100644 src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json create mode 100644 src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/README.md create mode 100644 src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.php create mode 100644 src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.power create mode 100644 src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json create mode 100644 src/f21388dc-5ddc-4970-a3c2-55f075024762/README.md create mode 100644 src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php create mode 100644 src/f21388dc-5ddc-4970-a3c2-55f075024762/code.power create mode 100644 src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json create mode 100644 src/f34442df-c84c-44c3-9991-bbf72bffa635/README.md create mode 100644 src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php create mode 100644 src/f34442df-c84c-44c3-9991-bbf72bffa635/code.power create mode 100644 src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json diff --git a/README.md b/README.md index 7d575f5..f8bd26c 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,16 @@ This repository contains an index (see below) of all the approved powers within - **final class AccessSwitchList** | [Details](src/81212121-ad5c-43c5-b046-f2650864f690) | [Code](src/81212121-ad5c-43c5-b046-f2650864f690/code.php) | [Settings](src/81212121-ad5c-43c5-b046-f2650864f690/settings.json) | Super__81212121_ad5c_43c5_b046_f2650864f690__Power - **final class AdminFilterType** | [Details](src/9481caa2-6d04-4598-8320-543a93927243) | [Code](src/9481caa2-6d04-4598-8320-543a93927243/code.php) | [Settings](src/9481caa2-6d04-4598-8320-543a93927243/settings.json) | Super__9481caa2_6d04_4598_8320_543a93927243__Power - **final class Alias** | [Details](src/fe87df7f-b65f-4778-8875-6122ab6b025f) | [Code](src/fe87df7f-b65f-4778-8875-6122ab6b025f/code.php) | [Settings](src/fe87df7f-b65f-4778-8875-6122ab6b025f/settings.json) | Super__fe87df7f_b65f_4778_8875_6122ab6b025f__Power + - **final class AssetsRules** | [Details](src/9b5872d6-c1d8-4602-b443-5844d2c950ee) | [Code](src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php) | [Settings](src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json) | Super__9b5872d6_c1d8_4602_b443_5844d2c950ee__Power - **final class BaseSixFour** | [Details](src/b8b474d4-30e3-4b5a-9988-3adb3450998c) | [Code](src/b8b474d4-30e3-4b5a-9988-3adb3450998c/code.php) | [Settings](src/b8b474d4-30e3-4b5a-9988-3adb3450998c/settings.json) | Super__b8b474d4_30e3_4b5a_9988_3adb3450998c__Power - **final class Category** | [Details](src/007177eb-d39d-4093-8840-07a38811c502) | [Code](src/007177eb-d39d-4093-8840-07a38811c502/code.php) | [Settings](src/007177eb-d39d-4093-8840-07a38811c502/settings.json) | Super__007177eb_d39d_4093_8840_07a38811c502__Power - **final class CategoryCode** | [Details](src/b24f5184-7e7c-448d-9475-ff3f998f70c3) | [Code](src/b24f5184-7e7c-448d-9475-ff3f998f70c3/code.php) | [Settings](src/b24f5184-7e7c-448d-9475-ff3f998f70c3/settings.json) | Super__b24f5184_7e7c_448d_9475_ff3f998f70c3__Power - **final class CategoryOtherName** | [Details](src/a1e551a9-8369-48c9-a076-4e5beb65e0df) | [Code](src/a1e551a9-8369-48c9-a076-4e5beb65e0df/code.php) | [Settings](src/a1e551a9-8369-48c9-a076-4e5beb65e0df/settings.json) | Super__a1e551a9_8369_48c9_a076_4e5beb65e0df__Power - **final class CheckBox** | [Details](src/8561f1f6-96c7-4e54-8869-0132116d57ce) | [Code](src/8561f1f6-96c7-4e54-8869-0132116d57ce/code.php) | [Settings](src/8561f1f6-96c7-4e54-8869-0132116d57ce/settings.json) | Super__8561f1f6_96c7_4e54_8869_0132116d57ce__Power - **final class ComponentFields** | [Details](src/3230dd65-6590-4043-9bb8-bebd6d8224b2) | [Code](src/3230dd65-6590-4043-9bb8-bebd6d8224b2/code.php) | [Settings](src/3230dd65-6590-4043-9bb8-bebd6d8224b2/settings.json) | Super__3230dd65_6590_4043_9bb8_bebd6d8224b2__Power + - **final class ConfigFieldsets** | [Details](src/0a524af3-f647-4f62-a422-d7d36ebe749b) | [Code](src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php) | [Settings](src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json) | Super__0a524af3_f647_4f62_a422_d7d36ebe749b__Power + - **final class ConfigFieldsetsCustomfield** | [Details](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b) | [Code](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.php) | [Settings](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json) | Super__ed314bd8_c995_4282_bcaa_5e0a68ac401b__Power + - **final class Contributors** | [Details](src/274a78d1-24c2-4486-b560-b86e9ae72872) | [Code](src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php) | [Settings](src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json) | Super__274a78d1_24c2_4486_b560_b86e9ae72872__Power - **final class CustomAlias** | [Details](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806) | [Code](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806/code.php) | [Settings](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806/settings.json) | Super__9d74d613_5ef7_4cf1_9f12_64f0a8e19806__Power - **final class CustomField** | [Details](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a) | [Code](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a/code.php) | [Settings](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a/settings.json) | Super__87d1da23_08d6_4fbf_bd0d_b746da240b8a__Power - **final class CustomFieldLinks** | [Details](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317) | [Code](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317/code.php) | [Settings](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317/settings.json) | Super__a4857c60_680c_4e0c_ae8f_9250a7b5e317__Power @@ -82,14 +86,17 @@ This repository contains an index (see below) of all the approved powers within - **final class DoNotEscape** | [Details](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2) | [Code](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2/code.php) | [Settings](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2/settings.json) | Super__0d9d3294_0bed_4c44_b1a1_e172f62cafb2__Power - **final class DynamicFields** | [Details](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076) | [Code](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076/code.php) | [Settings](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076/settings.json) | Super__1ae9a8e8_59f7_4844_a08d_9a4dce4be076__Power - **final class ExtensionCustomFields** | [Details](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92) | [Code](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92/code.php) | [Settings](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92/settings.json) | Super__e9b6b06b_f600_4f9d_984d_79c70ae7ae92__Power + - **final class ExtensionsParams** | [Details](src/bcf1e767-1566-440d-9f67-5c1bada934fa) | [Code](src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php) | [Settings](src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json) | Super__bcf1e767_1566_440d_9f67_5c1bada934fa__Power - **final class FieldGroupControl** | [Details](src/d5530adf-c809-45a9-87fc-7cecd3d972d8) | [Code](src/d5530adf-c809-45a9-87fc-7cecd3d972d8/code.php) | [Settings](src/d5530adf-c809-45a9-87fc-7cecd3d972d8/settings.json) | Super__d5530adf_c809_45a9_87fc_7cecd3d972d8__Power - **final class FieldNames** | [Details](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66) | [Code](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66/code.php) | [Settings](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66/settings.json) | Super__961a2a2e_9f95_4b5f_b1c0_62ee783f9c66__Power - **final class FieldRelations** | [Details](src/a090a472-eb3d-4086-a6d5-4215e1b1851f) | [Code](src/a090a472-eb3d-4086-a6d5-4215e1b1851f/code.php) | [Settings](src/a090a472-eb3d-4086-a6d5-4215e1b1851f/settings.json) | Super__a090a472_eb3d_4086_a6d5_4215e1b1851f__Power - **final class Filter** | [Details](src/e4e65c5b-00ec-439c-96bf-3153c3a73398) | [Code](src/e4e65c5b-00ec-439c-96bf-3153c3a73398/code.php) | [Settings](src/e4e65c5b-00ec-439c-96bf-3153c3a73398/settings.json) | Super__e4e65c5b_00ec_439c_96bf_3153c3a73398__Power - **final class FootableScripts** | [Details](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3) | [Code](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3/code.php) | [Settings](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3/settings.json) | Super__dba0776e_e582_4f73_af3e_e7ed17bc34b3__Power + - **final class FrontendParams** | [Details](src/207b5ef3-b3bb-45bf-af14-4572e296d761) | [Code](src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php) | [Settings](src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json) | Super__207b5ef3_b3bb_45bf_af14_4572e296d761__Power - **final class GetAsLookup** | [Details](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a) | [Code](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a/code.php) | [Settings](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a/settings.json) | Super__8f46f85d_7921_44e9_a40e_dc4f01c5d43a__Power - **final class GetModule** | [Details](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63) | [Code](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63/code.php) | [Settings](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63/settings.json) | Super__c7b6f0d5_ec47_4166_915c_e78d49b4fb63__Power - **final class GoogleChart** | [Details](src/507ab90f-7d64-4697-9815-d96f5d1d1185) | [Code](src/507ab90f-7d64-4697-9815-d96f5d1d1185/code.php) | [Settings](src/507ab90f-7d64-4697-9815-d96f5d1d1185/settings.json) | Super__507ab90f_7d64_4697_9815_d96f5d1d1185__Power + - **final class HasMenuGlobal** | [Details](src/6992384f-4f29-489f-a52e-286e03f4593b) | [Code](src/6992384f-4f29-489f-a52e-286e03f4593b/code.php) | [Settings](src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json) | Super__6992384f_4f29_489f_a52e_286e03f4593b__Power - **final class HasPermissions** | [Details](src/e54965e7-34fd-481e-b40c-4da089afec5a) | [Code](src/e54965e7-34fd-481e-b40c-4da089afec5a/code.php) | [Settings](src/e54965e7-34fd-481e-b40c-4da089afec5a/settings.json) | Super__e54965e7_34fd_481e_b40c_4da089afec5a__Power - **final class HiddenFields** | [Details](src/0b45357f-b077-4337-92f3-65c1e19d36cd) | [Code](src/0b45357f-b077-4337-92f3-65c1e19d36cd/code.php) | [Settings](src/0b45357f-b077-4337-92f3-65c1e19d36cd/settings.json) | Super__0b45357f_b077_4337_92f3_65c1e19d36cd__Power - **final class History** | [Details](src/2cb33994-052e-42dd-adbc-3ea9f932816f) | [Code](src/2cb33994-052e-42dd-adbc-3ea9f932816f/code.php) | [Settings](src/2cb33994-052e-42dd-adbc-3ea9f932816f/settings.json) | Super__2cb33994_052e_42dd_adbc_3ea9f932816f__Power @@ -99,6 +106,7 @@ This repository contains an index (see below) of all the approved powers within - **final class JsonItem** | [Details](src/45652787-9085-4c67-914f-0da25ae62646) | [Code](src/45652787-9085-4c67-914f-0da25ae62646/code.php) | [Settings](src/45652787-9085-4c67-914f-0da25ae62646/settings.json) | Super__45652787_9085_4c67_914f_0da25ae62646__Power - **final class JsonItemArray** | [Details](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb) | [Code](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb/code.php) | [Settings](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb/settings.json) | Super__6b386f2e_3eb1_4f60_81af_a90c8da1ffeb__Power - **final class JsonString** | [Details](src/bb26cf63-69a5-4c43-b2df-43284c9d907d) | [Code](src/bb26cf63-69a5-4c43-b2df-43284c9d907d/code.php) | [Settings](src/bb26cf63-69a5-4c43-b2df-43284c9d907d/settings.json) | Super__bb26cf63_69a5_4c43_b2df_43284c9d907d__Power + - **final class LanguageMessages** | [Details](src/44efa649-736d-4656-a0ec-e4f1653a6742) | [Code](src/44efa649-736d-4656-a0ec-e4f1653a6742/code.php) | [Settings](src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json) | Super__44efa649_736d_4656_a0ec_e4f1653a6742__Power - **final class Layout** | [Details](src/a90a2495-9c26-446c-867e-9ee8f42fb6af) | [Code](src/a90a2495-9c26-446c-867e-9ee8f42fb6af/code.php) | [Settings](src/a90a2495-9c26-446c-867e-9ee8f42fb6af/settings.json) | Super__a90a2495_9c26_446c_867e_9ee8f42fb6af__Power - **final class LayoutData** | [Details](src/7415fdb4-5719-40b7-b01f-05588e968b47) | [Code](src/7415fdb4-5719-40b7-b01f-05588e968b47/code.php) | [Settings](src/7415fdb4-5719-40b7-b01f-05588e968b47/settings.json) | Super__7415fdb4_5719_40b7_b01f_05588e968b47__Power - **final class LibraryManager** | [Details](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8) | [Code](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8/code.php) | [Settings](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8/settings.json) | Super__e696927b_e8f4_4cfc_9d25_215db4e3c7a8__Power @@ -127,8 +135,10 @@ This repository contains an index (see below) of all the approved powers within - **final class PermissionComponent** | [Details](src/94f4939f-82cc-4196-802b-1346ce5c7f99) | [Code](src/94f4939f-82cc-4196-802b-1346ce5c7f99/code.php) | [Settings](src/94f4939f-82cc-4196-802b-1346ce5c7f99/settings.json) | Super__94f4939f_82cc_4196_802b_1346ce5c7f99__Power - **final class PermissionCore** | [Details](src/5e3d856d-8174-4131-b4e9-9328066438e1) | [Code](src/5e3d856d-8174-4131-b4e9-9328066438e1/code.php) | [Settings](src/5e3d856d-8174-4131-b4e9-9328066438e1/settings.json) | Super__5e3d856d_8174_4131_b4e9_9328066438e1__Power - **final class PermissionDashboard** | [Details](src/e046b530-47fe-406f-b45a-b5eec8cbb238) | [Code](src/e046b530-47fe-406f-b45a-b5eec8cbb238/code.php) | [Settings](src/e046b530-47fe-406f-b45a-b5eec8cbb238/settings.json) | Super__e046b530_47fe_406f_b45a_b5eec8cbb238__Power + - **final class PermissionFields** | [Details](src/5133a033-1351-43ec-9692-2907d7b9aacd) | [Code](src/5133a033-1351-43ec-9692-2907d7b9aacd/code.php) | [Settings](src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json) | Super__5133a033_1351_43ec_9692_2907d7b9aacd__Power - **final class PermissionGlobalAction** | [Details](src/a601888d-12b6-427f-94ae-95004206e24e) | [Code](src/a601888d-12b6-427f-94ae-95004206e24e/code.php) | [Settings](src/a601888d-12b6-427f-94ae-95004206e24e/settings.json) | Super__a601888d_12b6_427f_94ae_95004206e24e__Power - **final class PermissionViews** | [Details](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a) | [Code](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a/code.php) | [Settings](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a/settings.json) | Super__480d11b9_783b_45d5_bce1_b0c2fcaad08a__Power + - **final class Request** | [Details](src/98419ff3-6628-4539-8365-37f88378bced) | [Code](src/98419ff3-6628-4539-8365-37f88378bced/code.php) | [Settings](src/98419ff3-6628-4539-8365-37f88378bced/settings.json) | Super__98419ff3_6628_4539_8365_37f88378bced__Power - **final class ScriptMediaSwitch** | [Details](src/17bf80af-3609-4f36-a520-be1a339c278b) | [Code](src/17bf80af-3609-4f36-a520-be1a339c278b/code.php) | [Settings](src/17bf80af-3609-4f36-a520-be1a339c278b/settings.json) | Super__17bf80af_3609_4f36_a520_be1a339c278b__Power - **final class ScriptUserSwitch** | [Details](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36) | [Code](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36/code.php) | [Settings](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36/settings.json) | Super__9042fac6_5ca5_4ebe_94fe_cf9b0718ed36__Power - **final class Search** | [Details](src/2e764839-8ec6-4726-af50-b5678e0714a4) | [Code](src/2e764839-8ec6-4726-af50-b5678e0714a4/code.php) | [Settings](src/2e764839-8ec6-4726-af50-b5678e0714a4/settings.json) | Super__2e764839_8ec6_4726_af50_b5678e0714a4__Power @@ -146,6 +156,7 @@ This repository contains an index (see below) of all the approved powers within - **final class TemplateData** | [Details](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade) | [Code](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade/code.php) | [Settings](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade/settings.json) | Super__8591f6db_dd3c_4a63_9b3f_574c0ec74ade__Power - **final class Title** | [Details](src/6a1dddb3-a955-425e-b713-8ef81f256035) | [Code](src/6a1dddb3-a955-425e-b713-8ef81f256035/code.php) | [Settings](src/6a1dddb3-a955-425e-b713-8ef81f256035/settings.json) | Super__6a1dddb3_a955_425e_b713_8ef81f256035__Power - **final class UikitComp** | [Details](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d) | [Code](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d/code.php) | [Settings](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d/settings.json) | Super__54ec57f6_2fc3_42e5_975e_1fabeacb845d__Power + - **final class ViewsDefaultOrdering** | [Details](src/f34442df-c84c-44c3-9991-bbf72bffa635) | [Code](src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php) | [Settings](src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json) | Super__f34442df_c84c_44c3_9991_bbf72bffa635__Power - **class ContentMulti** | [Details](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95) | [Code](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95/code.php) | [Settings](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95/settings.json) | Super__5f57ff1a_c196_45b1_a2ac_33766b44fb95__Power - **class ContentOne** | [Details](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75) | [Code](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php) | [Settings](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json) | Super__adfbe68a_6d22_43e5_aee8_2787e8c47e75__Power - **class UpdateMysql** | [Details](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9) | [Code](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php) | [Settings](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json) | Super__2b5c9989_1d4e_4f59_8b95_5cd2f72f82d9__Power @@ -154,13 +165,25 @@ This repository contains an index (see below) of all the approved powers within - **final class Dashboard** | [Details](src/cfe62a32-8818-4bfb-8751-2f1e109b5336) | [Code](src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php) | [Settings](src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json) | Super__cfe62a32_8818_4bfb_8751_2f1e109b5336__Power - **final class Data** | [Details](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753) | [Code](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php) | [Settings](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json) | Super__ef9578e5_4c9d_46bf_866f_3a94bdc7b753__Power - **final class Placeholder** | [Details](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb) | [Code](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php) | [Settings](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json) | Super__aecc17ba_0b0f_4e5c_ae43_71be063a3dcb__Power - - **final class Settings** | [Details](src/63dabe82-0f4a-4ade-9851-8518ade23de2) | [Code](src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php) | [Settings](src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json) | Super__63dabe82_0f4a_4ade_9851_8518ade23de2__Power - **final class Structure** | [Details](src/6c89c663-78f5-4078-9fac-7047f2eaaf96) | [Code](src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php) | [Settings](src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json) | Super__6c89c663_78f5_4078_9fac_7047f2eaaf96__Power - **final class Structuremultiple** | [Details](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c) | [Code](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php) | [Settings](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json) | Super__b69a23db_0a62_4840_a9c5_b2d8d63ecc6c__Power - **final class Structuresingle** | [Details](src/673954d3-78d3-445a-b99f-4b40d617c882) | [Code](src/673954d3-78d3-445a-b99f-4b40d617c882/code.php) | [Settings](src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json) | Super__673954d3_78d3_445a_b99f_4b40d617c882__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Creator](#vdm-joomla-componentbuilder-compiler-creator) + - **final class AccessSections** | [Details](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9) | [Code](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php) | [Settings](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json) | Super__15615db0_02b9_454f_a82e_1ab39ae5e6a9__Power + - **final class AccessSectionsCategory** | [Details](src/6d179307-b6e5-4f50-962b-5b6360d0759e) | [Code](src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.php) | [Settings](src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json) | Super__6d179307_b6e5_4f50_962b_5b6360d0759e__Power + - **final class AccessSectionsJoomlaFields** | [Details](src/396f9883-4e50-4b65-a1d5-05bd6c23df30) | [Code](src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php) | [Settings](src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json) | Super__396f9883_4e50_4b65_a1d5_05bd6c23df30__Power - **final class Builders** | [Details](src/55278140-80d5-4168-8241-d64515c4b35e) | [Code](src/55278140-80d5-4168-8241-d64515c4b35e/code.php) | [Settings](src/55278140-80d5-4168-8241-d64515c4b35e/settings.json) | Super__55278140_80d5_4168_8241_d64515c4b35e__Power + - **final class ConfigFieldsets** | [Details](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53) | [Code](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php) | [Settings](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json) | Super__20cf1825_29d0_4c6c_8fe9_a1e13a4dac53__Power + - **final class ConfigFieldsetsCustomfield** | [Details](src/208bc37c-0055-44df-9a34-63d6bfa10765) | [Code](src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php) | [Settings](src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json) | Super__208bc37c_0055_44df_9a34_63d6bfa10765__Power + - **final class ConfigFieldsetsEmailHelper** | [Details](src/d80e58b8-8462-47c4-9dcd-380445f1c64a) | [Code](src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php) | [Settings](src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json) | Super__d80e58b8_8462_47c4_9dcd_380445f1c64a__Power + - **final class ConfigFieldsetsEncryption** | [Details](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab) | [Code](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.php) | [Settings](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json) | Super__5e3fc314_646b_4834_8b1a_1a79f3d4d2ab__Power + - **final class ConfigFieldsetsGlobal** | [Details](src/0fe3133d-1ff3-4444-9229-4218d8fb338e) | [Code](src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php) | [Settings](src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json) | Super__0fe3133d_1ff3_4444_9229_4218d8fb338e__Power + - **final class ConfigFieldsetsGooglechart** | [Details](src/31c8127c-0d42-4e09-be81-7cf243c5b30f) | [Code](src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php) | [Settings](src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json) | Super__31c8127c_0d42_4e09_be81_7cf243c5b30f__Power + - **final class ConfigFieldsetsGroupControl** | [Details](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74) | [Code](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php) | [Settings](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json) | Super__a8d9583a_6ddb_4aac_b0d1_4c2d2d1c8c74__Power + - **final class ConfigFieldsetsSiteControl** | [Details](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11) | [Code](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php) | [Settings](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json) | Super__aac8502a_dbdf_42b6_a9ba_2c2e941f8b11__Power + - **final class ConfigFieldsetsUikit** | [Details](src/84c11075-570a-4907-9be0-9305e0fabe3c) | [Code](src/84c11075-570a-4907-9be0-9305e0fabe3c/code.php) | [Settings](src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json) | Super__84c11075_570a_4907_9be0_9305e0fabe3c__Power + - **final class CustomButtonPermissions** | [Details](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7) | [Code](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php) | [Settings](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json) | Super__8bf026e7_9ae0_423c_b74b_5bc16c54acf7__Power - **final class CustomFieldTypeFile** | [Details](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96) | [Code](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php) | [Settings](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json) | Super__6dced3d9_7d10_4ea1_bcf6_a5e6af4b9c96__Power - **final class FieldAsString** | [Details](src/f48764e0-16c6-459c-8576-af7616f3b720) | [Code](src/f48764e0-16c6-459c-8576-af7616f3b720/code.php) | [Settings](src/f48764e0-16c6-459c-8576-af7616f3b720/settings.json) | Super__f48764e0_16c6_459c_8576_af7616f3b720__Power - **final class FieldDynamic** | [Details](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e) | [Code](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e/code.php) | [Settings](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e/settings.json) | Super__4801f8b0_4a4a_4eda_8f0e_cf77f042c35e__Power @@ -171,6 +194,7 @@ This repository contains an index (see below) of all the approved powers within - **final class FieldsetXML** | [Details](src/79739667-72c6-4576-9830-7b1eb92e4791) | [Code](src/79739667-72c6-4576-9830-7b1eb92e4791/code.php) | [Settings](src/79739667-72c6-4576-9830-7b1eb92e4791/settings.json) | Super__79739667_72c6_4576_9830_7b1eb92e4791__Power - **final class Layout** | [Details](src/a0f032db-2242-41df-8e4a-5e9e6f88201d) | [Code](src/a0f032db-2242-41df-8e4a-5e9e6f88201d/code.php) | [Settings](src/a0f032db-2242-41df-8e4a-5e9e6f88201d/settings.json) | Super__a0f032db_2242_41df_8e4a_5e9e6f88201d__Power - **final class Permission** | [Details](src/7f01622a-74c9-4e67-b111-3eb488035206) | [Code](src/7f01622a-74c9-4e67-b111-3eb488035206/code.php) | [Settings](src/7f01622a-74c9-4e67-b111-3eb488035206/settings.json) | Super__7f01622a_74c9_4e67_b111_3eb488035206__Power + - **final class Request** | [Details](src/cfdf0968-f394-4459-933c-ad1674fb1041) | [Code](src/cfdf0968-f394-4459-933c-ad1674fb1041/code.php) | [Settings](src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json) | Super__cfdf0968_f394_4459_933c_ad1674fb1041__Power - **final class SiteFieldData** | [Details](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1) | [Code](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1/code.php) | [Settings](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1/settings.json) | Super__15b4addf_bf6b_4691_9c92_858c7de9c2c1__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customcode](#vdm-joomla-componentbuilder-compiler-customcode) @@ -191,25 +215,31 @@ This repository contains an index (see below) of all the approved powers within - **final class Attributes** | [Details](src/7f515c18-d019-4d2d-9852-b2dc970985b3) | [Code](src/7f515c18-d019-4d2d-9852-b2dc970985b3/code.php) | [Settings](src/7f515c18-d019-4d2d-9852-b2dc970985b3/settings.json) | Super__7f515c18_d019_4d2d_9852_b2dc970985b3__Power - **final class Groups** | [Details](src/12df35ad-2d44-4c4c-a7d5-a3350932a520) | [Code](src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php) | [Settings](src/12df35ad-2d44-4c4c-a7d5-a3350932a520/settings.json) | Super__12df35ad_2d44_4c4c_a7d5_a3350932a520__Power - - **final class InputButton** | [Details](src/c600f58c-3fe2-4d2d-b711-2660eab6effe) | [Code](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php) | [Settings](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json) | Super__c600f58c_3fe2_4d2d_b711_2660eab6effe__Power - **class Customcode** | [Details](src/a356d103-74f3-49ca-8e4f-3bd37746f089) | [Code](src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php) | [Settings](src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json) | Super__a356d103_74f3_49ca_8e4f_3bd37746f089__Power - **class Data** | [Details](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee) | [Code](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php) | [Settings](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json) | Super__ce826b66_0f2d_43da_8005_41b8e4cb21ee__Power - **class DatabaseName** | [Details](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6) | [Code](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php) | [Settings](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json) | Super__99368a6f_2f64_4d4e_ad3a_544d4020ecc6__Power - **class Name** | [Details](src/9387215f-a965-4421-acf3-5e8f9d11382f) | [Code](src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php) | [Settings](src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json) | Super__9387215f_a965_4421_acf3_5e8f9d11382f__Power + - **class Rule** | [Details](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557) | [Code](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php) | [Settings](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json) | Super__c871fb4a_4c33_4302_bb79_a9cd7ef4a557__Power - **class TypeName** | [Details](src/eb33420d-359d-44a5-852e-613aef1feaae) | [Code](src/eb33420d-359d-44a5-852e-613aef1feaae/code.php) | [Settings](src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json) | Super__eb33420d_359d_44a5_852e_613aef1feaae__Power - **class UniqueName** | [Details](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e) | [Code](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php) | [Settings](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json) | Super__8c018533_e967_4bf2_9bd9_9e92966fcb5e__Power - - **class Validation** | [Details](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557) | [Code](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php) | [Settings](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json) | Super__c871fb4a_4c33_4302_bb79_a9cd7ef4a557__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces](#vdm-joomla-componentbuilder-compiler-interfaces) - **interface CustomcodeInterface** | [Details](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4) | [Code](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php) | [Settings](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json) | Super__33bdc535_0ff1_40c8_bb22_b5d44f1731c4__Power - **interface EventInterface** | [Details](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d) | [Code](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php) | [Settings](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json) | Super__20ed72b0_fcac_4344_aee1_8a65e3bf221d__Power - **interface GetScriptInterface** | [Details](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890) | [Code](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php) | [Settings](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json) | Super__2e6731ba_3a03_4836_b2c2_4e50e38cb890__Power + - **interface HeaderInterface** | [Details](src/3a777d70-52ad-49ec-9016-6f7438608613) | [Code](src/3a777d70-52ad-49ec-9016-6f7438608613/code.php) | [Settings](src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json) | Super__3a777d70_52ad_49ec_9016_6f7438608613__Power - **interface HistoryInterface** | [Details](src/4325745f-da1f-4d4d-a591-3189fe8c06e5) | [Code](src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php) | [Settings](src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json) | Super__4325745f_da1f_4d4d_a591_3189fe8c06e5__Power - **interface LanguageInterface** | [Details](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83) | [Code](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php) | [Settings](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json) | Super__d6592c9b_93a6_41b3_83c7_c43a0a80cb83__Power - **interface PlaceholderInterface** | [Details](src/a6cdd935-c038-4a54-8446-54bed87f003c) | [Code](src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php) | [Settings](src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json) | Super__a6cdd935_c038_4a54_8446_54bed87f003c__Power - **interface PowerInterface** | [Details](src/1133c2d7-ba7e-4c95-8cde-01f084d04682) | [Code](src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php) | [Settings](src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json) | Super__1133c2d7_ba7e_4c95_8cde_01f084d04682__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaFour](#vdm-joomla-componentbuilder-compiler-joomlafour) + + - **final class Header** | [Details](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49) | [Code](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php) | [Settings](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json) | Super__1ee227b9_da0f_4e7b_ae66_99a9d53f6f49__Power + - **class Event** | [Details](src/4729c2b0-f12b-4397-8d77-055d38bca98b) | [Code](src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php) | [Settings](src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json) | Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power + - **class History** | [Details](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba) | [Code](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php) | [Settings](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json) | Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree) + - **final class Header** | [Details](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b) | [Code](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php) | [Settings](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json) | Super__7b56a097_9979_477b_b18a_c9dfc2f1e13b__Power - **class Event** | [Details](src/4b86f62e-ce41-4325-a11a-08148807d0df) | [Code](src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php) | [Settings](src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json) | Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power - **class History** | [Details](src/87db51b9-1126-4c21-858b-53dbd3a68b61) | [Code](src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php) | [Settings](src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json) | Super__87db51b9_1126_4c21_858b_53dbd3a68b61__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Joomlamodule](#vdm-joomla-componentbuilder-compiler-joomlamodule) @@ -283,6 +313,8 @@ This repository contains an index (see below) of all the approved powers within - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Service](#vdm-joomla-componentbuilder-compiler-service) - **class Adminview** | [Details](src/2dd1289a-4000-43cc-8c62-77ff32de56bf) | [Code](src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php) | [Settings](src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json) | Super__2dd1289a_4000_43cc_8c62_77ff32de56bf__Power + - **class ArchitectureController** | [Details](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60) | [Code](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php) | [Settings](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json) | Super__56ba30f5_a5c4_4c4c_be6f_a56f7f9cbc60__Power + - **class ArchitectureModel** | [Details](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712) | [Code](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php) | [Settings](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json) | Super__bbd36fbf_d905_47e8_8e67_9ea6ec734712__Power - **class Builder** | [Details](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7) | [Code](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php) | [Settings](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json) | Super__2c76c06e_a371_4b73_9fbe_b4d9b4df55d7__Power - **class Compiler** | [Details](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69) | [Code](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php) | [Settings](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json) | Super__ea5ed06e_72ae_4906_9167_1cc0fa32fe69__Power - **class Component** | [Details](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c) | [Code](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php) | [Settings](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json) | Super__8a63e87b_b39b_4a15_8044_9b2a2f4fb61c__Power @@ -292,6 +324,7 @@ This repository contains an index (see below) of all the approved powers within - **class Event** | [Details](src/b94aaedb-6774-4739-a63f-8f87141a85db) | [Code](src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php) | [Settings](src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json) | Super__b94aaedb_6774_4739_a63f_8f87141a85db__Power - **class Extension** | [Details](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d) | [Code](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php) | [Settings](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json) | Super__ed9591cb_0a03_400a_bf47_eaf78ab19b9d__Power - **class Field** | [Details](src/c6c30d66-3106-44eb-9272-b2cf7ec74613) | [Code](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php) | [Settings](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json) | Super__c6c30d66_3106_44eb_9272_b2cf7ec74613__Power + - **class Header** | [Details](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d) | [Code](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php) | [Settings](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json) | Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power - **class History** | [Details](src/63782f74-7b03-4745-aa40-0adf8ed4e704) | [Code](src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php) | [Settings](src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json) | Super__63782f74_7b03_4745_aa40_0adf8ed4e704__Power - **class Joomlamodule** | [Details](src/295186de-5954-4a65-a4c1-2f79ef305743) | [Code](src/295186de-5954-4a65-a4c1-2f79ef305743/code.php) | [Settings](src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json) | Super__295186de_5954_4a65_a4c1_2f79ef305743__Power - **class Joomlaplugin** | [Details](src/9eba241c-af90-42dd-ae05-92ff4d8391d3) | [Code](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php) | [Settings](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json) | Super__9eba241c_af90_42dd_ae05_92ff4d8391d3__Power @@ -312,6 +345,7 @@ This repository contains an index (see below) of all the approved powers within - **abstract class Line** | [Details](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222) | [Code](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php) | [Settings](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json) | Super__4e6ff11d_bebf_42f5_8fd7_b2f882857222__Power - **abstract class Placefix** | [Details](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388) | [Code](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php) | [Settings](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json) | Super__500f3a7f_c16d_4dd4_81b2_2df6776b5388__Power - **abstract class Unique** | [Details](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e) | [Code](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php) | [Settings](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json) | Super__f02fb1df_f4b6_4be1_9595_2e72084a5e6e__Power + - **final class FileInjector** | [Details](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb) | [Code](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php) | [Settings](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json) | Super__23f2ca33_440a_4941_8e9a_4bc67522c0cb__Power - **final class Xml** | [Details](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b) | [Code](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b/code.php) | [Settings](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b/settings.json) | Super__f6ba34a2_0cd7_4dc1_ab67_75e962a5045b__Power - **class Counter** | [Details](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4) | [Code](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php) | [Settings](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json) | Super__e6d871a6_bbe7_497d_af01_68f6bb9a87f4__Power - **class Dynamicpath** | [Details](src/268b85ef-49f3-4c39-8187-bb12e38d19ee) | [Code](src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php) | [Settings](src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json) | Super__268b85ef_49f3_4c39_8187_bb12e38d19ee__Power @@ -344,18 +378,35 @@ This repository contains an index (see below) of all the approved powers within - **class Generator** | [Details](src/a7101bbc-3c81-4b52-a4aa-522291f7594b) | [Code](src/a7101bbc-3c81-4b52-a4aa-522291f7594b/code.php) | [Settings](src/a7101bbc-3c81-4b52-a4aa-522291f7594b/settings.json) | Super__a7101bbc_3c81_4b52_a4aa_522291f7594b__Power - **class Gitea** | [Details](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae) | [Code](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae/code.php) | [Settings](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae/settings.json) | Super__510dc0f6_da3f_4a78_b43d_3a03e2cb5fae__Power - **class Power** | [Details](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9) | [Code](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9/code.php) | [Settings](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9/settings.json) | Super__02bc072b_1e89_46c1_9732_4da77b1a9ac9__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour](#vdm-joomla-componentbuilder-compiler-component-joomlafour) + + - **final class Settings** | [Details](src/e7fff971-b031-42bf-8009-ef554e30854d) | [Code](src/e7fff971-b031-42bf-8009-ef554e30854d/code.php) | [Settings](src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json) | Super__e7fff971_b031_42bf_8009_ef554e30854d__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree](#vdm-joomla-componentbuilder-compiler-component-joomlathree) + + - **final class Settings** | [Details](src/63dabe82-0f4a-4ade-9851-8518ade23de2) | [Code](src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php) | [Settings](src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json) | Super__63dabe82_0f4a_4ade_9851_8518ade23de2__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor](#vdm-joomla-componentbuilder-compiler-customcode-extractor) - **class Paths** | [Details](src/053803e6-1251-4aed-aefe-46a8e84198d2) | [Code](src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php) | [Settings](src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json) | Super__053803e6_1251_4aed_aefe_46a8e84198d2__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour](#vdm-joomla-componentbuilder-compiler-extension-joomlafour) + + - **class InstallScript** | [Details](src/d42e1fac-3c05-4a22-8878-2abd43019811) | [Code](src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php) | [Settings](src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json) | Super__d42e1fac_3c05_4a22_8878_2abd43019811__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree](#vdm-joomla-componentbuilder-compiler-extension-joomlathree) - **class InstallScript** | [Details](src/1d929017-a5de-4e0f-9b5a-838934857e26) | [Code](src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php) | [Settings](src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json) | Super__1d929017_a5de_4e0f_9b5a_838934857e26__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour](#vdm-joomla-componentbuilder-compiler-field-joomlafour) + + - **final class InputButton** | [Details](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe) | [Code](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php) | [Settings](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json) | Super__1b8a40e9_7847_4341_8a8e_dfdc2d531bbe__Power + - **class CoreField** | [Details](src/c6818275-cdf7-4fce-a365-90d95a77a71c) | [Code](src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php) | [Settings](src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json) | Super__c6818275_cdf7_4fce_a365_90d95a77a71c__Power + - **class CoreRule** | [Details](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb) | [Code](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php) | [Settings](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json) | Super__43f46bb2_ab6d_47c7_9fd9_f1745a3576fb__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree](#vdm-joomla-componentbuilder-compiler-field-joomlathree) - - **class CoreValidation** | [Details](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957) | [Code](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php) | [Settings](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json) | Super__24da9672_e47f_4bb1_b6c0_0ebfc17f0957__Power + - **final class InputButton** | [Details](src/2bc33733-e900-4a9c-8cb3-c537aa9db785) | [Code](src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php) | [Settings](src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json) | Super__2bc33733_e900_4a9c_8cb3_c537aa9db785__Power + - **class CoreField** | [Details](src/e6683873-b74e-4b54-8466-69f8a9282033) | [Code](src/e6683873-b74e-4b54-8466-69f8a9282033/code.php) | [Settings](src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json) | Super__e6683873_b74e_4b54_8466_69f8a9282033__Power + - **class CoreRule** | [Details](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957) | [Code](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php) | [Settings](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json) | Super__24da9672_e47f_4bb1_b6c0_0ebfc17f0957__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component](#vdm-joomla-componentbuilder-compiler-interfaces-component) - **interface PlaceholderInterface** | [Details](src/97698747-c2ce-4e09-a470-acf6d8e86281) | [Code](src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php) | [Settings](src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json) | Super__97698747_c2ce_4e09_a470_acf6d8e86281__Power + - **interface SettingsInterface** | [Details](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9) | [Code](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php) | [Settings](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json) | Super__5f44e66a_31d0_45ff_92b3_b7372dc57ae9__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator](#vdm-joomla-componentbuilder-compiler-interfaces-creator) - **interface Fielddynamicinterface** | [Details](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f) | [Code](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f/code.php) | [Settings](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f/settings.json) | Super__c902743e_8c6e_4a50_a4a3_8c955ef2960f__Power @@ -373,13 +424,39 @@ This repository contains an index (see below) of all the approved powers within - **interface InstallInterface** | [Details](src/1aefb8f5-486f-4f00-adf9-696340b3254e) | [Code](src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php) | [Settings](src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json) | Super__1aefb8f5_486f_4f00_adf9_696340b3254e__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field](#vdm-joomla-componentbuilder-compiler-interfaces-field) - - **interface CoreValidationInterface** | [Details](src/b9f05dc4-d23a-499a-a826-9749b81818ed) | [Code](src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php) | [Settings](src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json) | Super__b9f05dc4_d23a_499a_a826_9749b81818ed__Power + - **interface CoreFieldInterface** | [Details](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900) | [Code](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.php) | [Settings](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json) | Super__e2f5fddf_cbc8_44ee_836c_7f3fb08d8900__Power + - **interface CoreRuleInterface** | [Details](src/b9f05dc4-d23a-499a-a826-9749b81818ed) | [Code](src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php) | [Settings](src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json) | Super__b9f05dc4_d23a_499a_a826_9749b81818ed__Power + - **interface InputButtonInterface** | [Details](src/c600f58c-3fe2-4d2d-b711-2660eab6effe) | [Code](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php) | [Settings](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json) | Super__c600f58c_3fe2_4d2d_b711_2660eab6effe__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power\Repo](#vdm-joomla-componentbuilder-compiler-power-repo) - **class Readme** | [Details](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5) | [Code](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php) | [Settings](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json) | Super__efb1d0f8_2d14_4d2c_8b5f_4fcdd9df45a5__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power\Repos](#vdm-joomla-componentbuilder-compiler-power-repos) - **class Readme** | [Details](src/0d08c583-04d5-454e-b756-48ca05e1651a) | [Code](src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php) | [Settings](src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json) | Super__0d08c583_04d5_454e_b756_48ca05e1651a__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller](#vdm-joomla-componentbuilder-compiler-architecture-joomlafour-controller) + + - **final class AllowAdd** | [Details](src/425b1107-933d-4436-87ac-63540ec101c5) | [Code](src/425b1107-933d-4436-87ac-63540ec101c5/code.php) | [Settings](src/425b1107-933d-4436-87ac-63540ec101c5/settings.json) | Super__425b1107_933d_4436_87ac_63540ec101c5__Power + - **final class AllowEdit** | [Details](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533) | [Code](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php) | [Settings](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json) | Super__ddf31f4b_96ba_46e7_8100_f48e1cefe533__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model](#vdm-joomla-componentbuilder-compiler-architecture-joomlafour-model) + + - **final class CanDelete** | [Details](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f) | [Code](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php) | [Settings](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json) | Super__2a69a8ab_cea0_4c75_92d5_9495cb740e0f__Power + - **final class CanEditState** | [Details](src/cb2a82a5-aa49-4d46-b765-9b3feb118208) | [Code](src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php) | [Settings](src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json) | Super__cb2a82a5_aa49_4d46_b765_9b3feb118208__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller](#vdm-joomla-componentbuilder-compiler-architecture-joomlathree-controller) + + - **final class AllowAdd** | [Details](src/f21388dc-5ddc-4970-a3c2-55f075024762) | [Code](src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php) | [Settings](src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json) | Super__f21388dc_5ddc_4970_a3c2_55f075024762__Power + - **final class AllowEdit** | [Details](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f) | [Code](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php) | [Settings](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json) | Super__8faaed82_522d_4f78_bd43_0ab3f7c72e5f__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model](#vdm-joomla-componentbuilder-compiler-architecture-joomlathree-model) + + - **final class CanDelete** | [Details](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd) | [Code](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php) | [Settings](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json) | Super__23766738_d0a4_4d0a_8555_7e4c97c0cddd__Power + - **final class CanEditState** | [Details](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe) | [Code](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php) | [Settings](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json) | Super__bce9ac2b_9f46_413f_b046_9e8af3f7dfbe__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller](#vdm-joomla-componentbuilder-compiler-interfaces-architecture-controller) + + - **interface AllowAddInterface** | [Details](src/c9700450-4f44-4455-bc86-6a7660daadee) | [Code](src/c9700450-4f44-4455-bc86-6a7660daadee/code.php) | [Settings](src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json) | Super__c9700450_4f44_4455_bc86_6a7660daadee__Power + - **interface AllowEditInterface** | [Details](src/992a842f-1ba9-4a5c-b214-042459ffe038) | [Code](src/992a842f-1ba9-4a5c-b214-042459ffe038/code.php) | [Settings](src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json) | Super__992a842f_1ba9_4a5c_b214_042459ffe038__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model](#vdm-joomla-componentbuilder-compiler-interfaces-architecture-model) + + - **interface CanDeleteInterface** | [Details](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91) | [Code](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.php) | [Settings](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json) | Super__e00a7d1d_6d80_41c5_bf13_32d41bc5bf91__Power + - **interface CanEditStateInterface** | [Details](src/600515b1-493f-4448-96fe-018e54e087c8) | [Code](src/600515b1-493f-4448-96fe-018e54e087c8/code.php) | [Settings](src/600515b1-493f-4448-96fe-018e54e087c8/settings.json) | Super__600515b1_493f_4448_96fe_018e54e087c8__Power --- ``` diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md index 531cef0..5809f36 100644 --- a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md @@ -11,6 +11,7 @@ ```uml @startuml class Extractor #Gold { + # int $currentVersion # array $existing # array $new # array $done @@ -24,9 +25,9 @@ class Extractor #Gold { # Reverse $reverse # Placeholder $componentPlaceholder # Pathfix $pathfix - # User $user - # \JDatabaseDriver $db - # CMSApplication $app + # $user + # $db + # $app + __construct(?Config $config = null, ?Gui $gui = null, ...) + run() : void # searchFileContent(string $file, $target) : array @@ -49,9 +50,6 @@ note right of Extractor::__construct ?Reverse $reverse = null ?Placeholder $placeholder = null ?Pathfix $pathfix = null - ?User $user = null - ?\JDatabaseDriver $db = null - ?CMSApplication $app = null end note note left of Extractor::run diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php index bc52c68..0ef7008 100644 --- a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php @@ -16,7 +16,8 @@ use Joomla\CMS\Factory; use Joomla\CMS\User\User; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Application\CMSApplication; -use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Version; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; @@ -83,6 +84,14 @@ class Extractor implements ExtractorInterface 4 => 'INSERTED<>$$$$]' ]; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected int $currentVersion; + /** * The custom code in local files that already exist in system * @@ -190,26 +199,23 @@ class Extractor implements ExtractorInterface /** * Current User Object * - * @var User * @since 3.2.0 **/ - protected User $user; + protected $user; /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -220,16 +226,12 @@ class Extractor implements ExtractorInterface * @param Reverse|null $reverse The compiler placeholder reverse object. * @param Placeholder|null $placeholder The compiler component placeholder object. * @param Pathfix|null $pathfix The compiler path fixing object. - * @param User|null $user The current User object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null, - ?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null, - ?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null) { $this->config = $config ?: Compiler::_('Config'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); @@ -237,9 +239,9 @@ class Extractor implements ExtractorInterface $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); $this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder'); $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); - $this->user = $user ?: Factory::getUser(); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->user = Factory::getUser(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); // set today's date $this->today = Factory::getDate()->toSql(); @@ -261,6 +263,9 @@ class Extractor implements ExtractorInterface // set the local placeholders $this->placeholders = array_reverse($placeholders, true); + + // set the current version + $this->currentVersion = (int) Version::MAJOR_VERSION; } /** @@ -613,6 +618,11 @@ class Extractor implements ExtractorInterface 1 ); // 'target' + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $this->currentVersion + ); // 'joomla_version' + $this->new[$pointer[$targetKey]][] = $this->db->quote( $commentType @@ -766,7 +776,7 @@ class Extractor implements ExtractorInterface $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('path', 'type', 'target', 'comment_type', + $columns = array('path', 'type', 'target', 'joomla_version', 'comment_type', 'component', 'published', 'created', 'created_by', 'version', 'access', 'hashtarget', 'from_line', 'to_line', 'code', 'hashendtarget'); diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.power b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.power index a16e1a0..4a490db 100644 --- a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.power +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.power @@ -12,6 +12,14 @@ 4 => 'INSERTED<>$$$$]' ]; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected int $currentVersion; + /** * The custom code in local files that already exist in system * @@ -119,26 +127,23 @@ /** * Current User Object * - * @var User * @since 3.2.0 **/ - protected User $user; + protected $user; /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -149,16 +154,12 @@ * @param Reverse|null $reverse The compiler placeholder reverse object. * @param Placeholder|null $placeholder The compiler component placeholder object. * @param Pathfix|null $pathfix The compiler path fixing object. - * @param User|null $user The current User object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null, - ?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null, - ?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null) { $this->config = $config ?: Compiler::_('Config'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); @@ -166,9 +167,9 @@ $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); $this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder'); $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); - $this->user = $user ?: Factory::getUser(); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->user = Factory::getUser(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); // set today's date $this->today = Factory::getDate()->toSql(); @@ -190,6 +191,9 @@ // set the local placeholders $this->placeholders = array_reverse($placeholders, true); + + // set the current version + $this->currentVersion = (int) Version::MAJOR_VERSION; } /** @@ -542,6 +546,11 @@ 1 ); // 'target' + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $this->currentVersion + ); // 'joomla_version' + $this->new[$pointer[$targetKey]][] = $this->db->quote( $commentType @@ -695,7 +704,7 @@ $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('path', 'type', 'target', 'comment_type', + $columns = array('path', 'type', 'target', 'joomla_version', 'comment_type', 'component', 'published', 'created', 'created_by', 'version', 'access', 'hashtarget', 'from_line', 'to_line', 'code', 'hashendtarget'); diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json index 484ef15..7c5da15 100644 --- a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json @@ -56,6 +56,6 @@ "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Extractor", "description": "Compiler Custom Code Extractor\r\n\r\nThe custom script placeholders - we use the (xxx) to avoid detection it should be (***)\r\n##################################---> PHP\/JS ---####################################\r\n\r\nNew Insert Code = \/xxx[INSERT>$$$$]xxx\/ \/xxx[\/INSERT>$$$$]xxx\/\r\nNew Replace Code = \/xxx[REPLACE>$$$$]xxx\/ \/xxx[\/REPLACE>$$$$]xxx\/\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ when JCB adds it back \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nJCB Add Inserted Code = \/xxx[INSERTED$$$$]xxx\/\/xx23xx\/ \/xxx[\/INSERTED$$$$]xxx\/\r\nJCB Add Replaced Code = \/xxx[REPLACED$$$$]xxx\/\/xx25xx\/ \/xxx[\/REPLACED$$$$]xxx\/\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ changeing existing custom code \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nUpdate Inserted Code = \/xxx[INSERTED>$$$$]xxx\/\/xx23xx\/ \/xxx[\/INSERTED>$$$$]xxx\/\r\nUpdate Replaced Code = \/xxx[REPLACED>$$$$]xxx\/\/xx25xx\/ \/xxx[\/REPLACED>$$$$]xxx\/\r\n\r\nThe custom script placeholders - we use the (==) to avoid detection it should be (--)\r\n###################################---> HTML ---#####################################\r\n\r\nNew Insert Code = !==[INSERT>$$$$]==> !==[\/INSERT>$$$$]==>\r\nNew Replace Code = !==[REPLACE>$$$$]==> !==[\/REPLACE>$$$$]==>\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ when JCB adds it back \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nJCB Add Inserted Code = \r\nJCB Add Replaced Code = \r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ changeing existing custom code \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nUpdate Inserted Code = !==[INSERTED>$$$$]==> !==[\/INSERTED>$$$$]==>\r\nUpdate Replaced Code = !==[REPLACED>$$$$]==> !==[\/REPLACED>$$$$]==>\r\n\r\n\/\/\/\/\/\/\/\/23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\r\nMore info read: https:\/\/git.vdm.dev\/joomla\/Component-Builder\/wiki\/TIPS:-Custom-Code\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", - "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\User\\User;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\User\\User;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Version;", "composer": "" } \ No newline at end of file diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php index ed1ed41..4780f73 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php @@ -230,17 +230,13 @@ class Infusion // infuse super powers details if set if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->superpowers as $path => $powers) { $key = StringHelper::safe($path); // Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onBeforeInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); // we add and all missing powers @@ -260,8 +256,7 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onAfterInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); } } @@ -306,17 +301,13 @@ class Infusion // infuse powers data if set if (ArrayHelper::check($this->power->active)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->active as $power) { if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData $this->event->trigger( - 'jcb_ce_onBeforeInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onBeforeInfusePowerData', [&$power] ); // POWERCODE @@ -333,8 +324,7 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfusePowerData $this->event->trigger( - 'jcb_ce_onAfterInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onAfterInfusePowerData', [&$power] ); } } diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power index 122ab9f..e34c353 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power @@ -195,17 +195,13 @@ // infuse super powers details if set if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->superpowers as $path => $powers) { $key = StringHelper::safe($path); // Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onBeforeInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); // we add and all missing powers @@ -225,8 +221,7 @@ // Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onAfterInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); } } @@ -271,17 +266,13 @@ // infuse powers data if set if (ArrayHelper::check($this->power->active)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->active as $power) { if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData $this->event->trigger( - 'jcb_ce_onBeforeInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onBeforeInfusePowerData', [&$power] ); // POWERCODE @@ -298,8 +289,7 @@ // Trigger Event: jcb_ce_onAfterInfusePowerData $this->event->trigger( - 'jcb_ce_onAfterInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onAfterInfusePowerData', [&$power] ); } } diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md b/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md index f80b313..f9dfbc1 100644 --- a/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md @@ -17,7 +17,7 @@ class Paths #Gold { # Placeholder $placeholder # Customcode $customcode # Extractor $extractor - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) # load() : void # getModuleIDs() : mixed @@ -37,7 +37,6 @@ note right of Paths::__construct ?ComponentPlaceholder $componentPlaceholder = null ?Customcode $customcode = null ?Extractor $extractor = null - ?\JDatabaseDriver $db = null end note note right of Paths::load diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php index f4eac22..ed873b0 100644 --- a/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php @@ -84,10 +84,9 @@ class Paths /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -97,14 +96,13 @@ class Paths * @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object. * @param Customcode|null $customcode The compiler customcode object. * @param Extractor|null $extractor The compiler language extractor object. - * @param \JDatabaseDriver|null $db The Database Driver object. * * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, ?ComponentPlaceholder $componentPlaceholder = null, ?Customcode $customcode = null, - ?Extractor $extractor = null, ?\JDatabaseDriver $db = null) + ?Extractor $extractor = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); @@ -112,7 +110,7 @@ class Paths $componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); // load the placeholders to local array $this->componentPlaceholder = $componentPlaceholder->get(); diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.power b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.power index a2a75ad..1e22209 100644 --- a/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.power +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.power @@ -49,10 +49,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -62,14 +61,13 @@ * @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object. * @param Customcode|null $customcode The compiler customcode object. * @param Extractor|null $extractor The compiler language extractor object. - * @param \JDatabaseDriver|null $db The Database Driver object. * * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, ?ComponentPlaceholder $componentPlaceholder = null, ?Customcode $customcode = null, - ?Extractor $extractor = null, ?\JDatabaseDriver $db = null) + ?Extractor $extractor = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); @@ -77,7 +75,7 @@ $componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); // load the placeholders to local array $this->componentPlaceholder = $componentPlaceholder->get(); diff --git a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php index 270627e..19934d0 100644 --- a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php +++ b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php @@ -231,18 +231,16 @@ final class FieldsetString implements Fieldsetinterface $dynamic_fields = ''; // set the custom table key $dbkey = 'g'; - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; - $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeBuildFields $this->event->trigger( 'jcb_ce_onBeforeBuildFields', - array(&$component_context, &$dynamic_fields, &$read_only, + [&$dynamic_fields, &$read_only, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -252,17 +250,16 @@ final class FieldsetString implements Fieldsetinterface true ); } - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; + // Trigger Event: jcb_ce_onAfterBuildFields $this->event->trigger( 'jcb_ce_onAfterBuildFields', - array(&$component_context, &$dynamic_fields, &$read_only, + [&$dynamic_fields, &$read_only, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // set the default fields $field_set = array(); $field_set[] = '
'; diff --git a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power index fc47f64..f20e695 100644 --- a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power +++ b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power @@ -192,18 +192,16 @@ $dynamic_fields = ''; // set the custom table key $dbkey = 'g'; - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; - $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeBuildFields $this->event->trigger( 'jcb_ce_onBeforeBuildFields', - array(&$component_context, &$dynamic_fields, &$read_only, + [&$dynamic_fields, &$read_only, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -213,17 +211,16 @@ true ); } - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; + // Trigger Event: jcb_ce_onAfterBuildFields $this->event->trigger( 'jcb_ce_onAfterBuildFields', - array(&$component_context, &$dynamic_fields, &$read_only, + [&$dynamic_fields, &$read_only, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // set the default fields $field_set = array(); $field_set[] = '
'; diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md index 6f3e3d6..8e146f3 100644 --- a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md @@ -19,7 +19,7 @@ class Data #Gold { # Dispenser $dispenser # Gui $gui # Dynamicget $dynamic - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?Registry $registry = null, ...) + get(array $ids, string $view_code, ...) : ?array } @@ -37,7 +37,6 @@ note right of Data::__construct ?Dispenser $dispenser = null ?Gui $gui = null ?Dynamicget $dynamic = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php index 1d269f7..25d55ac 100644 --- a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php @@ -104,10 +104,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -119,14 +118,13 @@ class Data * @param Dispenser|null $dispenser The compiler customcode dispenser object. * @param Gui|null $gui The compiler customcode gui. * @param Dynamicget|null $dynamic The compiler dynamicget modeller object. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ public function __construct(?Config $config = null, ?Registry $registry = null, ?EventInterface $event = null, ?Customcode $customcode = null, ?Dispenser $dispenser = null, ?Gui $gui = null, - ?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null) + ?Dynamicget $dynamic = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -135,7 +133,7 @@ class Data $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -157,9 +155,6 @@ class Data $ids = implode(',', $ids); - // for plugin event TODO change event api signatures - $component_context = $this->config->component_context; - // Create a new query object. $query = $this->db->getQuery(true); $query->select('a.*'); @@ -176,8 +171,7 @@ class Data { // Trigger Event: jcb_ce_onBeforeModelDynamicGetData $this->event->trigger( - 'jcb_ce_onBeforeModelDynamicGetData', - array(&$component_context, &$result, &$result->id, &$view_code, &$context) + 'jcb_ce_onBeforeModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context] ); // set GUI mapper id @@ -310,8 +304,7 @@ class Data // Trigger Event: jcb_ce_onAfterModelDynamicGetData $this->event->trigger( - 'jcb_ce_onAfterModelDynamicGetData', - array(&$component_context, &$result, &$result->id, &$view_code, &$context) + 'jcb_ce_onAfterModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context] ); } diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.power b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.power index 89dfccb..c77c74e 100644 --- a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.power +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.power @@ -70,10 +70,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -85,14 +84,13 @@ * @param Dispenser|null $dispenser The compiler customcode dispenser object. * @param Gui|null $gui The compiler customcode gui. * @param Dynamicget|null $dynamic The compiler dynamicget modeller object. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ public function __construct(?Config $config = null, ?Registry $registry = null, ?EventInterface $event = null, ?Customcode $customcode = null, ?Dispenser $dispenser = null, ?Gui $gui = null, - ?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null) + ?Dynamicget $dynamic = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -101,7 +99,7 @@ $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -123,9 +121,6 @@ $ids = implode(',', $ids); - // for plugin event TODO change event api signatures - $component_context = $this->config->component_context; - // Create a new query object. $query = $this->db->getQuery(true); $query->select('a.*'); @@ -142,8 +137,7 @@ { // Trigger Event: jcb_ce_onBeforeModelDynamicGetData $this->event->trigger( - 'jcb_ce_onBeforeModelDynamicGetData', - array(&$component_context, &$result, &$result->id, &$view_code, &$context) + 'jcb_ce_onBeforeModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context] ); // set GUI mapper id @@ -276,8 +270,7 @@ // Trigger Event: jcb_ce_onAfterModelDynamicGetData $this->event->trigger( - 'jcb_ce_onAfterModelDynamicGetData', - array(&$component_context, &$result, &$result->id, &$view_code, &$context) + 'jcb_ce_onAfterModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context] ); } diff --git a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php index 8379e6e..7ccbfb9 100644 --- a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php +++ b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php @@ -716,8 +716,8 @@ class Structure $bucket[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Custom CSS"; $bucket[] = Indent::_(2) - . "\$document->addStyleSheet('" . $targetPath - . "/modules/" . $module->folder_name + . "Html::_('stylesheet', " + . "modules/" . $module->folder_name . "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);"; } } @@ -771,7 +771,7 @@ class Structure $bucket[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Custom JS"; $bucket[] = Indent::_(2) - . "\$document->addScript('" . $targetPath + . "Html::_('script', " . "/modules/" . $module->folder_name . "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);"; } @@ -839,14 +839,30 @@ class Structure if ($add_component_path) { $xml .= PHP_EOL . 'config->get('joomla_version', 3) == 3) + { + $xml .= PHP_EOL . Indent::_(1) + . 'addrulepath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(1) + . 'addfieldpath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/fields"'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'; + $xml .= PHP_EOL . Indent::_(1) + .'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'; + } + $xml .= PHP_EOL . '>'; } else diff --git a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.power b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.power index 44a1d5c..27fd5cf 100644 --- a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.power +++ b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.power @@ -675,8 +675,8 @@ $bucket[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Custom CSS"; $bucket[] = Indent::_(2) - . "\$document->addStyleSheet('" . $targetPath - . "/modules/" . $module->folder_name + . "Html::_('stylesheet', " + . "modules/" . $module->folder_name . "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);"; } } @@ -730,7 +730,7 @@ $bucket[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Custom JS"; $bucket[] = Indent::_(2) - . "\$document->addScript('" . $targetPath + . "Html::_('script', " . "/modules/" . $module->folder_name . "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);"; } @@ -798,14 +798,30 @@ if ($add_component_path) { $xml .= PHP_EOL . 'config->get('joomla_version', 3) == 3) + { + $xml .= PHP_EOL . Indent::_(1) + . 'addrulepath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(1) + . 'addfieldpath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/fields"'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'; + $xml .= PHP_EOL . Indent::_(1) + .'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'; + } + $xml .= PHP_EOL . '>'; } else diff --git a/src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md new file mode 100644 index 0000000..cbde552 --- /dev/null +++ b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsets (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class ConfigFieldsets << (F,LightGreen) >> #RoyalBlue { + # bool $addAsArray +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php new file mode 100644 index 0000000..26a0c64 --- /dev/null +++ b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/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\Builder; + + +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Config Field Sets Builder Class + * + * @since 3.2.0 + */ +final class ConfigFieldsets extends Registry implements Registryinterface +{ + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; +} + diff --git a/src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power new file mode 100644 index 0000000..d570439 --- /dev/null +++ b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power @@ -0,0 +1,7 @@ + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; \ No newline at end of file diff --git a/src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json new file mode 100644 index 0000000..024a828 --- /dev/null +++ b/src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "ConfigFieldsets", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.ConfigFieldsets", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.ConfigFieldsets", + "description": "Config Field Sets Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md new file mode 100644 index 0000000..2737b93 --- /dev/null +++ b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md @@ -0,0 +1,65 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsGlobal (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsGlobal << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # Component $component + # Contributors $contributors + # ConfigFieldsets $configfieldsets + # ExtensionsParams $extensionsparams + # Customfield $customfield + + __construct(Config $config, Language $language, ...) + + set(string $lang, string $authorName, ...) : void +} + +note right of ConfigFieldsetsGlobal::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + Component $component + Contributors $contributors + ConfigFieldsets $configfieldsets + ExtensionsParams $extensionsparams + Customfield $customfield +end note + +note right of ConfigFieldsetsGlobal::set + Set Global Config Fieldsets + + since: 3.2.0 + return: void + + arguments: + string $lang + string $authorName + string $authorEmail +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php new file mode 100644 index 0000000..343fdb0 --- /dev/null +++ b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php @@ -0,0 +1,634 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Config Fieldsets Global Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsGlobal +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The Contributors Class. + * + * @var Contributors + * @since 3.2.0 + */ + protected Contributors $contributors; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param Contributors $contributors The Contributors Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + Contributors $contributors, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->contributors = $contributors; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Global Config Fieldsets + * + * @param string $lang + * @param string $authorName + * @param string $authorEmail + * + * @since 3.2.0 + */ + public function set(string $lang, string $authorName, string $authorEmail): void + { + // start building field set for config + $this->configfieldsets->add('component', 'config->get('joomla_version', 3) == 3) + { + $this->configfieldsets->add('component', Indent::_(2) + . 'addrulepath="/administrator/components/com_' . $this->config->component_code_name + . '/models/rules"'); + $this->configfieldsets->add('component', Indent::_(2) + . 'addfieldpath="/administrator/components/com_' . $this->config->component_code_name + . '/models/fields"'); + } + else + { + $this->configfieldsets->add('component', Indent::_(2) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'); + $this->configfieldsets->add('component', Indent::_(2) + . 'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'); + } + $this->configfieldsets->add('component', Indent::_(2) . 'name="global_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_GLOBAL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_GLOBAL_DESC">'); + // setup lang + $this->language->set($this->config->lang_target, $lang . '_GLOBAL_LABEL', "Global"); + $this->language->set( + $this->config->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters" + ); + + // add auto checkin if required + if ($this->config->get('add_checkin', false)) + { + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="check_in"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_CHECK_TIMER_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_CHECK_TIMER_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-5 hours">' + . $lang . '_CHECK_TIMER_OPTION_ONE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-12 hours">' + . $lang . '_CHECK_TIMER_OPTION_TWO'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-1 day">' . $lang + . '_CHECK_TIMER_OPTION_THREE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-2 day">' . $lang + . '_CHECK_TIMER_OPTION_FOUR'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-1 week">' . $lang + . '_CHECK_TIMER_OPTION_FIVE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="0">' . $lang + . '_CHECK_TIMER_OPTION_SIX'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ''); + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_LABEL', "Check in timer" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_DESC', + "Set the intervals for the auto checkin fuction of tables that checks out the items to an user." + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_ONE', + "Every five hours" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_TWO', + "Every twelve hours" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FOUR', + "Every second day" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_SIX', "Never" + ); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"check_in":"-1 day"'); + } + + // set history control + if ($this->config->get('set_tag_history', false)) + { + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="save_history"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="1"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . ">"); + $this->configfieldsets->add('component', Indent::_(3) + . ''); + $this->configfieldsets->add('component', Indent::_(3) + . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="history_limit"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'filter="integer"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="10"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . ''); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"save_history":"1","history_limit":"10"'); + } + // add custom global fields + if ($this->customfield->isArray('Global')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Global') + )); + $this->customfield->remove('Global'); + } + // set the author details + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_AUTHOR_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorName . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_AUTHOR_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorEmail . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // setup lang + $this->language->set($this->config->lang_target, $lang . '_AUTHOR', "Author Info"); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_NAME_LABEL', "Author Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_NAME_DESC', + "The name of the author of this component." + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_EMAIL_DESC', + "The email address of the author of this component." + ); + + // set if contributors were added + $langCont = $lang . '_CONTRIBUTOR'; + if ($this->config->get('add_contributors', false) + && $this->component->isArray('contributors')) + { + foreach ( + $this->component->get('contributors') as $counter => $contributor + ) + { + // make sure we dont use 0 + $counter++; + // get the word for this number + $COUNTER = StringHelper::safe($counter, 'U'); + // set the dynamic values + $cbTitle = htmlspecialchars( + (string) $contributor['title'], ENT_XML1, 'UTF-8' + ); + $cbName = htmlspecialchars( + (string) $contributor['name'], ENT_XML1, 'UTF-8' + ); + $cbEmail = htmlspecialchars( + (string) $contributor['email'], ENT_XML1, 'UTF-8' + ); + $cbWebsite = htmlspecialchars( + (string) $contributor['website'], ENT_XML1, 'UTF-8' + ); // StringHelper::html($contributor['website']); + // load to the $fieldsets + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_TITLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_TITLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbTitle + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbName + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbEmail + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="url"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_LINK_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_LINK_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . $cbWebsite . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . (int) $contributor['use'] . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_USE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_USE_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . (int) $contributor['show'] . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_SHOW_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_SHOW_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // add the contributor + $this->contributors->add('bom', PHP_EOL . Indent::_(1) . "@" + . strtolower((string) $contributor['title']) . Indent::_(2) + . $contributor['name'] . ' <' . $contributor['website'] + . '>'); + // setup lang + $Counter = StringHelper::safe($counter, 'Ww'); + $this->language->set( + $this->config->lang_target, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"titleContributor' . $counter + . '":"' . $cbTitle . '"'); + $this->extensionsparams->add('component', '"nameContributor' . $counter + . '":"' . $cbName . '"'); + $this->extensionsparams->add('component', '"emailContributor' . $counter + . '":"' . $cbEmail . '"'); + $this->extensionsparams->add('component', '"linkContributor' . $counter + . '":"' . $cbWebsite . '"'); + $this->extensionsparams->add('component', '"useContributor' . $counter . '":"' + . (int) $contributor['use'] . '"'); + $this->extensionsparams->add('component', '"showContributor' . $counter + . '":"' . (int) $contributor['show'] . '"'); + } + } + + // add more contributors if required + if (1 == $this->component->get('emptycontributors', 0)) + { + if (isset($counter)) + { + $min = $counter + 1; + unset($counter); + } + else + { + $min = 1; + } + $max = $min + $this->component->get('number') - 1; + $moreContributerFields = range($min, $max, 1); + foreach ($moreContributerFields as $counter) + { + $COUNTER = StringHelper::safe($counter, 'U'); + + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_TITLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_TITLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="url"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_LINK_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_LINK_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_USE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_USE_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_SHOW_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_SHOW_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // setup lang + $Counter = StringHelper::safe($counter, 'Ww'); + $this->language->set( + $this->config->lang_target, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); + } + } + + if ($this->config->get('add_contributors', false) + || $this->component->get('emptycontributors', 0) == 1) + { + // setup lang + $this->language->set( + $this->config->lang_target, $langCont . '_TITLE_LABEL', "Contributor Job Title" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_TITLE_DESC', + "The job title that best describes the contributor's relationship to this component." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_NAME_LABEL', "Contributor Name" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_NAME_DESC', + "The name of this contributor." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_EMAIL_LABEL', "Contributor Email" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_EMAIL_DESC', + "The email of this contributor." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_LINK_LABEL', "Contributor Website" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_LINK_DESC', + "The link to this contributor's website." + ); + $this->language->set($this->config->lang_target, $langCont . '_USE_LABEL', "Use"); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_DESC', + "How should we link to this contributor." + ); + $this->language->set($this->config->lang_target, $langCont . '_USE_NONE', "None"); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_EMAIL', "Email" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_WWW', "Website" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_LABEL', "Show" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_DESC', + "Select where you want this contributor's details to show in the component." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_NONE', "Hide" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_BACK', "Back-end" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_FRONT', "Front-end" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_ALL', "Both Front & Back-end" + ); + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . "
"); + } +} + diff --git a/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power new file mode 100644 index 0000000..0f279c8 --- /dev/null +++ b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power @@ -0,0 +1,600 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The Contributors Class. + * + * @var Contributors + * @since 3.2.0 + */ + protected Contributors $contributors; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param Contributors $contributors The Contributors Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + Contributors $contributors, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->contributors = $contributors; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Global Config Fieldsets + * + * @param string $lang + * @param string $authorName + * @param string $authorEmail + * + * @since 3.2.0 + */ + public function set(string $lang, string $authorName, string $authorEmail): void + { + // start building field set for config + $this->configfieldsets->add('component', 'config->get('joomla_version', 3) == 3) + { + $this->configfieldsets->add('component', Indent::_(2) + . 'addrulepath="/administrator/components/com_' . $this->config->component_code_name + . '/models/rules"'); + $this->configfieldsets->add('component', Indent::_(2) + . 'addfieldpath="/administrator/components/com_' . $this->config->component_code_name + . '/models/fields"'); + } + else + { + $this->configfieldsets->add('component', Indent::_(2) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'); + $this->configfieldsets->add('component', Indent::_(2) + . 'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'); + } + $this->configfieldsets->add('component', Indent::_(2) . 'name="global_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_GLOBAL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_GLOBAL_DESC">'); + // setup lang + $this->language->set($this->config->lang_target, $lang . '_GLOBAL_LABEL', "Global"); + $this->language->set( + $this->config->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters" + ); + + // add auto checkin if required + if ($this->config->get('add_checkin', false)) + { + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="check_in"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_CHECK_TIMER_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_CHECK_TIMER_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-5 hours">' + . $lang . '_CHECK_TIMER_OPTION_ONE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-12 hours">' + . $lang . '_CHECK_TIMER_OPTION_TWO'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-1 day">' . $lang + . '_CHECK_TIMER_OPTION_THREE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-2 day">' . $lang + . '_CHECK_TIMER_OPTION_FOUR'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="-1 week">' . $lang + . '_CHECK_TIMER_OPTION_FIVE'); + $this->configfieldsets->add('component', Indent::_(3) . 'configfieldsets->add('component', Indent::_(4) . 'value="0">' . $lang + . '_CHECK_TIMER_OPTION_SIX'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ''); + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_LABEL', "Check in timer" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_DESC', + "Set the intervals for the auto checkin fuction of tables that checks out the items to an user." + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_ONE', + "Every five hours" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_TWO', + "Every twelve hours" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FOUR', + "Every second day" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_SIX', "Never" + ); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"check_in":"-1 day"'); + } + + // set history control + if ($this->config->get('set_tag_history', false)) + { + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="save_history"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="1"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . ">"); + $this->configfieldsets->add('component', Indent::_(3) + . ''); + $this->configfieldsets->add('component', Indent::_(3) + . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . 'name="history_limit"'); + $this->configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'filter="integer"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="10"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . ''); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"save_history":"1","history_limit":"10"'); + } + // add custom global fields + if ($this->customfield->isArray('Global')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Global') + )); + $this->customfield->remove('Global'); + } + // set the author details + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_AUTHOR_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorName . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_AUTHOR_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_AUTHOR_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorEmail . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // setup lang + $this->language->set($this->config->lang_target, $lang . '_AUTHOR', "Author Info"); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_NAME_LABEL', "Author Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_NAME_DESC', + "The name of the author of this component." + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_AUTHOR_EMAIL_DESC', + "The email address of the author of this component." + ); + + // set if contributors were added + $langCont = $lang . '_CONTRIBUTOR'; + if ($this->config->get('add_contributors', false) + && $this->component->isArray('contributors')) + { + foreach ( + $this->component->get('contributors') as $counter => $contributor + ) + { + // make sure we dont use 0 + $counter++; + // get the word for this number + $COUNTER = StringHelper::safe($counter, 'U'); + // set the dynamic values + $cbTitle = htmlspecialchars( + (string) $contributor['title'], ENT_XML1, 'UTF-8' + ); + $cbName = htmlspecialchars( + (string) $contributor['name'], ENT_XML1, 'UTF-8' + ); + $cbEmail = htmlspecialchars( + (string) $contributor['email'], ENT_XML1, 'UTF-8' + ); + $cbWebsite = htmlspecialchars( + (string) $contributor['website'], ENT_XML1, 'UTF-8' + ); // StringHelper::html($contributor['website']); + // load to the $fieldsets + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_TITLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_TITLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbTitle + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbName + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbEmail + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="url"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_LINK_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_LINK_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . $cbWebsite . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . (int) $contributor['use'] . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_USE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_USE_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="' + . (int) $contributor['show'] . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_SHOW_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_SHOW_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // add the contributor + $this->contributors->add('bom', PHP_EOL . Indent::_(1) . "@" + . strtolower((string) $contributor['title']) . Indent::_(2) + . $contributor['name'] . ' <' . $contributor['website'] + . '>'); + // setup lang + $Counter = StringHelper::safe($counter, 'Ww'); + $this->language->set( + $this->config->lang_target, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); + // load the Global checkin defautls + $this->extensionsparams->add('component', '"titleContributor' . $counter + . '":"' . $cbTitle . '"'); + $this->extensionsparams->add('component', '"nameContributor' . $counter + . '":"' . $cbName . '"'); + $this->extensionsparams->add('component', '"emailContributor' . $counter + . '":"' . $cbEmail . '"'); + $this->extensionsparams->add('component', '"linkContributor' . $counter + . '":"' . $cbWebsite . '"'); + $this->extensionsparams->add('component', '"useContributor' . $counter . '":"' + . (int) $contributor['use'] . '"'); + $this->extensionsparams->add('component', '"showContributor' . $counter + . '":"' . (int) $contributor['show'] . '"'); + } + } + + // add more contributors if required + if (1 == $this->component->get('emptycontributors', 0)) + { + if (isset($counter)) + { + $min = $counter + 1; + unset($counter); + } + else + { + $min = 1; + } + $max = $min + $this->component->get('number') - 1; + $moreContributerFields = range($min, $max, 1); + foreach ($moreContributerFields as $counter) + { + $COUNTER = StringHelper::safe($counter, 'U'); + + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="spacer"'); + $this->configfieldsets->add('component', Indent::_(3) . 'class="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_TITLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_TITLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_NAME_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_NAME_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="email"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_EMAIL_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="url"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_LINK_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_LINK_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_USE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_USE_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="list"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="0"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont + . '_SHOW_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $langCont . '_SHOW_DESC">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // setup lang + $Counter = StringHelper::safe($counter, 'Ww'); + $this->language->set( + $this->config->lang_target, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); + } + } + + if ($this->config->get('add_contributors', false) + || $this->component->get('emptycontributors', 0) == 1) + { + // setup lang + $this->language->set( + $this->config->lang_target, $langCont . '_TITLE_LABEL', "Contributor Job Title" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_TITLE_DESC', + "The job title that best describes the contributor's relationship to this component." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_NAME_LABEL', "Contributor Name" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_NAME_DESC', + "The name of this contributor." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_EMAIL_LABEL', "Contributor Email" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_EMAIL_DESC', + "The email of this contributor." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_LINK_LABEL', "Contributor Website" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_LINK_DESC', + "The link to this contributor's website." + ); + $this->language->set($this->config->lang_target, $langCont . '_USE_LABEL', "Use"); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_DESC', + "How should we link to this contributor." + ); + $this->language->set($this->config->lang_target, $langCont . '_USE_NONE', "None"); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_EMAIL', "Email" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_USE_WWW', "Website" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_LABEL', "Show" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_DESC', + "Select where you want this contributor's details to show in the component." + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_NONE', "Hide" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_BACK', "Back-end" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_FRONT', "Front-end" + ); + $this->language->set( + $this->config->lang_target, $langCont . '_SHOW_ALL', "Both Front & Back-end" + ); + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . "
"); + } \ No newline at end of file diff --git a/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json new file mode 100644 index 0000000..a71f71e --- /dev/null +++ b/src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json @@ -0,0 +1,55 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "0fe3133d-1ff3-4444-9229-4218d8fb338e", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsGlobal", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsGlobal", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "274a78d1-24c2-4486-b560-b86e9ae72872", + "as": "default" + }, + "use_selection4": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection5": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection6": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection7": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection8": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsGlobal", + "description": "Config Fieldsets Global Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/README.md b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/README.md index 65880c6..de2f2ce 100644 --- a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/README.md +++ b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/README.md @@ -11,8 +11,8 @@ ```uml @startuml class Groups << (F,LightGreen) >> #RoyalBlue { - # \JDatabaseDriver $db - + __construct(?\JDatabaseDriver $db = null) + # $db + + __construct() + check(string $type, string $option = 'default') : bool + types(array $groups = []) : ?array + typesIds(array $groups = []) : ?array diff --git a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php index 76e661e..ddf57c2 100644 --- a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php +++ b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php @@ -71,21 +71,18 @@ final class Groups /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 */ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The Database Driver object. - * * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.power b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.power index c883874..92bb72b 100644 --- a/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.power +++ b/src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.power @@ -45,21 +45,18 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 */ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The Database Driver object. - * * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md new file mode 100644 index 0000000..2cffd79 --- /dev/null +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md @@ -0,0 +1,74 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AccessSections (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class AccessSections << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Event $event + # Language $language + # Component $component + # FieldName $fieldname + # TypeName $typename + # Counter $counter + # Permission $permission + # AssetsRules $assetsrules + # CustomTabs $customtabs + # PermissionViews $permissionviews + # PermissionFields $permissionfields + # PermissionComponent $permissioncomponent + # CustomButtonPermissions $custombuttonpermissions + + __construct(Config $config, Event $event, ...) + + get() : string +} + +note right of AccessSections::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Event $event + Language $language + Component $component + FieldName $fieldname + TypeName $typename + Counter $counter + Permission $permission + AssetsRules $assetsrules + CustomTabs $customtabs + PermissionViews $permissionviews + PermissionFields $permissionfields + PermissionComponent $permissioncomponent + CustomButtonPermissions $custombuttonpermissions +end note + +note right of AccessSections::get + Get Access Sections + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php new file mode 100644 index 0000000..28fe043 --- /dev/null +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php @@ -0,0 +1,709 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent; +use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions; +use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Access Sections Creator Class + * + * @since 3.2.0 + */ +final class AccessSections +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The Name Class. + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldname; + + /** + * The TypeName Class. + * + * @var TypeName + * @since 3.2.0 + */ + protected TypeName $typename; + + /** + * The Counter Class. + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The AssetsRules Class. + * + * @var AssetsRules + * @since 3.2.0 + */ + protected AssetsRules $assetsrules; + + /** + * The CustomTabs Class. + * + * @var CustomTabs + * @since 3.2.0 + */ + protected CustomTabs $customtabs; + + /** + * The PermissionViews Class. + * + * @var PermissionViews + * @since 3.2.0 + */ + protected PermissionViews $permissionviews; + + /** + * The PermissionFields Class. + * + * @var PermissionFields + * @since 3.2.0 + */ + protected PermissionFields $permissionfields; + + /** + * The PermissionComponent Class. + * + * @var PermissionComponent + * @since 3.2.0 + */ + protected PermissionComponent $permissioncomponent; + + /** + * The CustomButtonPermissions Class. + * + * @var CustomButtonPermissions + * @since 3.2.0 + */ + protected CustomButtonPermissions $custombuttonpermissions; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param FieldName $fieldname The Name Class. + * @param TypeName $typename The TypeName Class. + * @param Counter $counter The Counter Class. + * @param Permission $permission The Permission Class. + * @param AssetsRules $assetsrules The AssetsRules Class. + * @param CustomTabs $customtabs The CustomTabs Class. + * @param PermissionViews $permissionviews The PermissionViews Class. + * @param PermissionFields $permissionfields The PermissionFields Class. + * @param PermissionComponent $permissioncomponent The PermissionComponent Class. + * @param CustomButtonPermissions $custombuttonpermissions The CustomButtonPermissions Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Language $language, + Component $component, FieldName $fieldname, + TypeName $typename, Counter $counter, + Permission $permission, AssetsRules $assetsrules, + CustomTabs $customtabs, PermissionViews $permissionviews, + PermissionFields $permissionfields, + PermissionComponent $permissioncomponent, + CustomButtonPermissions $custombuttonpermissions) + { + $this->config = $config; + $this->event = $event; + $this->language = $language; + $this->component = $component; + $this->fieldname = $fieldname; + $this->typename = $typename; + $this->counter = $counter; + $this->permission = $permission; + $this->assetsrules = $assetsrules; + $this->customtabs = $customtabs; + $this->permissionviews = $permissionviews; + $this->permissionfields = $permissionfields; + $this->permissioncomponent = $permissioncomponent; + $this->custombuttonpermissions = $custombuttonpermissions; + } + + /** + * Get Access Sections + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + // access size counter + $this->counter->accessSize = 12; // ;) + + // Trigger Event: jcb_ce_onBeforeBuildAccessSections + $this->event->trigger( + 'jcb_ce_onBeforeBuildAccessSections' + ); + + // Get the default fields + $default_fields = $this->config->default_fields; + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.admin', + 'title' => 'JACTION_ADMIN', + 'description' => 'JACTION_ADMIN_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.options', + 'title' => 'JACTION_OPTIONS', + 'description' => 'JACTION_OPTIONS_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.manage', + 'title' => 'JACTION_MANAGE', + 'description' => 'JACTION_MANAGE_COMPONENT_DESC' + ], true); + + if ($this->config->get('add_eximport', false)) + { + $exportTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Export Data', 'U'); + $exportDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Export Data', 'U') + . '_DESC'; + $this->language->set('bothadmin', $exportTitle, 'Export Data'); + $this->language->set( + 'bothadmin', $exportDesc, + ' Allows users in this group to export data.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.export', + 'title' => $exportTitle, + 'description' => $exportDesc + ], true); + + // the size needs increase + $this->counter->accessSize++; + $importTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Import Data', 'U'); + $importDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Import Data', 'U') + . '_DESC'; + $this->language->set('bothadmin', $importTitle, 'Import Data'); + $this->language->set( + 'bothadmin', $importDesc, + ' Allows users in this group to import data.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.import', + 'title' => $importTitle, + 'description' => $importDesc + ], true); + + // the size needs increase + $this->counter->accessSize++; + } + + // version permission + $batchTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Use Batch', 'U'); + $batchDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Use Batch', 'U') . '_DESC'; + $this->language->set('bothadmin', $batchTitle, 'Use Batch'); + $this->language->set( + 'bothadmin', $batchDesc, + ' Allows users in this group to use batch copy/update method.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.batch', + 'title' => $batchTitle, + 'description' => $batchDesc + ], true); + + // version permission + $importTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Versions', 'U'); + $importDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Versions', 'U') + . '_DESC'; + $this->language->set('bothadmin', $importTitle, 'Edit Version'); + $this->language->set( + 'bothadmin', $importDesc, + ' Allows users in this group to edit versions.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.version', + 'title' => $importTitle, + 'description' => $importDesc + ], true); + + // set the defaults + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.create', + 'title' => 'JACTION_CREATE', + 'description' => 'JACTION_CREATE_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.delete', + 'title' => 'JACTION_DELETE', + 'description' => 'JACTION_DELETE_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit', + 'title' => 'JACTION_EDIT', + 'description' => 'JACTION_EDIT_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.state', + 'title' => 'JACTION_EDITSTATE', + 'description' => 'JACTION_ACCESS_EDITSTATE_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.own', + 'title' => 'JACTION_EDITOWN', + 'description' => 'JACTION_EDITOWN_COMPONENT_DESC' + ], true); + + // set the Joomla fields + if ($this->config->get('set_joomla_fields', false)) + { + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.value', + 'title' => 'JACTION_EDITVALUE', + 'description' => 'JACTION_EDITVALUE_COMPONENT_DESC' + ], true); + + // the size needs increase + $this->counter->accessSize++; + } + + // new custom created by permissions + $created_byTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created By', 'U'); + $created_byDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created By', 'U') + . '_DESC'; + $this->language->set('bothadmin', $created_byTitle, 'Edit Created By'); + $this->language->set( + 'bothadmin', $created_byDesc, + ' Allows users in this group to edit created by.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.created_by', + 'title' => $created_byTitle, + 'description' => $created_byDesc + ], true); + + // new custom created date permissions + $createdTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created Date', 'U'); + $createdDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created Date', 'U') + . '_DESC'; + $this->language->set('bothadmin', $createdTitle, 'Edit Created Date'); + $this->language->set( + 'bothadmin', $createdDesc, + ' Allows users in this group to edit created date.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.created', + 'title' => $createdTitle, + 'description' => $createdDesc + ], true); + + // set the menu controller lookup + $menuControllers = ['access', 'submenu', 'dashboard_list', 'dashboard_add']; + + // set the custom admin views permissions + if ($this->component->isArray('custom_admin_views')) + { + foreach ($this->component->get('custom_admin_views') as $custom_admin_view) + { + // new custom permissions to access this view + $customAdminName = $custom_admin_view['settings']->name; + $customAdminCode = $custom_admin_view['settings']->code; + $customAdminTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $customAdminName . ' Access', 'U' + ); + $customAdminDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $customAdminName . ' Access', 'U' + ) . '_DESC'; + $sortKey = StringHelper::safe( + $customAdminName . ' Access' + ); + $this->language->set( + 'bothadmin', $customAdminTitle, $customAdminName . ' Access' + ); + $this->language->set( + 'bothadmin', $customAdminDesc, + ' Allows the users in this group to access ' + . StringHelper::safe($customAdminName, 'w') + . '.' + ); + $this->permissioncomponent->set($sortKey, [ + 'name' => "$customAdminCode.access", + 'title' => $customAdminTitle, + 'description' => $customAdminDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $custom_admin_view['settings'], $customAdminName, + $customAdminCode + ); + + // add menu controll view that has menus options + foreach ($menuControllers as $menuController) + { + // add menu controll view that has menus options + if (isset($custom_admin_view[$menuController]) + && $custom_admin_view[$menuController]) + { + $targetView_ = 'views.'; + if ($menuController === 'dashboard_add') + { + $targetView_ = 'view.'; + } + + // menucontroller + $menucontrollerView['action'] = $targetView_ + . $menuController; + $menucontrollerView['implementation'] = '2'; + if (isset($custom_admin_view['settings']->permissions) + && ArrayHelper::check( + $custom_admin_view['settings']->permissions + )) + { + array_push( + $custom_admin_view['settings']->permissions, + $menucontrollerView + ); + } + else + { + $custom_admin_view['settings']->permissions + = []; + $custom_admin_view['settings']->permissions[] + = $menucontrollerView; + } + unset($menucontrollerView); + } + } + + $this->permission ->set( + $custom_admin_view, $customAdminCode, $customAdminCode, + $menuControllers, 'customAdmin' + ); + } + } + + // set the site views permissions + if ($this->component->isArray('site_views')) + { + foreach ($this->component->get('site_views') as $site_view) + { + // new custom permissions to access this view + $siteName = $site_view['settings']->name; + $siteCode = $site_view['settings']->code; + $siteTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $siteName . ' Access Site', 'U' + ); + $siteDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $siteName . ' Access Site', 'U' + ) . '_DESC'; + $sortKey = StringHelper::safe( + $siteName . ' Access Site' + ); + + if (isset($site_view['access']) && $site_view['access'] == 1) + { + $this->language->set( + 'bothadmin', $siteTitle, $siteName . ' (Site) Access' + ); + $this->language->set( + 'bothadmin', $siteDesc, + ' Allows the users in this group to access site ' + . StringHelper::safe($siteName, 'w') + . '.' + ); + $this->permissioncomponent->set($sortKey, [ + 'name' => "site.$siteCode.access", + 'title' => $siteTitle, + 'description' => $siteDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + + // check if this site view requires access rule to default to public + if (isset($site_view['public_access']) + && $site_view['public_access'] == 1) + { + // we use one as public group (TODO we see if we run into any issues) + $this->assetsrules->add('site', '"site.' . $siteCode + . '.access":{"1":1}'); + } + } + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $site_view['settings'], $siteName, $siteCode + ); + } + } + + if ($this->component->isArray('admin_views')) + { + foreach ($this->component->get('admin_views') as $view) + { + // set view name + $nameView = StringHelper::safe( + $view['settings']->name_single + ); + $nameViews = StringHelper::safe( + $view['settings']->name_list + ); + + // add custom tab permissions if found + if (($tabs_ = $this->customtabs->get($nameView)) !== null + && ArrayHelper::check($tabs_)) + { + foreach ($tabs_ as $_customTab) + { + if (isset($_customTab['permission']) + && $_customTab['permission'] == 1) + { + $this->permissioncomponent->set($_customTab['sortKey'], [ + 'name' => $_customTab['view'] . '.' . $_customTab['code'] . '.viewtab', + 'title' => $_customTab['lang_permission'], + 'description' => $_customTab['lang_permission_desc'] + ]); + + // the size needs increase + $this->counter->accessSize++; + } + } + } + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $view['settings'], $view['settings']->name_single, $nameView + ); + + if ($nameView != 'component') + { + // add menu controll view that has menus options + foreach ($menuControllers as $menuController) + { + // add menu controll view that has menus options + if (isset($view[$menuController]) + && $view[$menuController]) + { + $targetView_ = 'views.'; + if ($menuController === 'dashboard_add') + { + $targetView_ = 'view.'; + } + // menucontroller + $menucontrollerView['action'] = $targetView_ . $menuController; + $menucontrollerView['implementation'] = '2'; + if (isset($view['settings']->permissions) + && ArrayHelper::check( + $view['settings']->permissions + )) + { + array_push( + $view['settings']->permissions, + $menucontrollerView + ); + } + else + { + $view['settings']->permissions = []; + $view['settings']->permissions[] = $menucontrollerView; + } + unset($menucontrollerView); + } + } + + // check if there are fields + if (ArrayHelper::check($view['settings']->fields)) + { + // field permission options + $permission_options = [1 => 'edit', 2 => 'access', 3 => 'view']; + + // check the fields for their permission settings + foreach ($view['settings']->fields as $field) + { + // see if field require permissions to be set + if (isset($field['permission']) + && ArrayHelper::check( + $field['permission'] + )) + { + if (ArrayHelper::check( + $field['settings']->properties + )) + { + $fieldType = $this->typename->get($field); + $fieldName = $this->fieldname->get( + $field, $nameViews + ); + + // loop the permission options + foreach ($field['permission'] as $permission_id) + { + // set the permission key word + $permission_option = $permission_options[(int) $permission_id]; + + // reset the bucket + $fieldView = []; + + // set the permission for this field + $fieldView['action'] = 'view.' . $permission_option . '.' . $fieldName; + $fieldView['implementation'] = '3'; + + // check if persmissions was already set + if (isset($view['settings']->permissions) + && ArrayHelper::check( + $view['settings']->permissions + )) + { + array_push($view['settings']->permissions, $fieldView); + } + else + { + $view['settings']->permissions = []; + $view['settings']->permissions[] = $fieldView; + } + + // ensure that no default field get loaded + if (!in_array($fieldName, $default_fields)) + { + // load to global field permission set + $this->permissionfields-> + set("$nameView.$fieldName.$permission_option", $fieldType); + } + } + } + } + } + } + $this->permission ->set( + $view, $nameView, $nameViews, $menuControllers + ); + } + } + + // Trigger Event: jcb_ce_onAfterBuildAccessSections + $this->event->trigger( + 'jcb_ce_onAfterBuildAccessSections' + ); + + /// now build the section + $component = $this->permissioncomponent->build(); + + // add views to the component section + $component .= $this->permissionviews->build(); + + // remove the fix, is not needed + if ($this->counter->accessSize < 30) + { + // since we have less than 30 actions + // we do not need the fix for this component + $this->config->set('add_assets_table_fix', 0); + } + else + { + // get the worst case column size required (can be worse I know) + // access/action size x 20 characters x 8 groups + $character_length = (int) MathHelper::bc( + 'mul', $this->counter->accessSize, 20, 0 + ); + + // set worse case + $this->config->set('access_worse_case', (int) MathHelper::bc( + 'mul', $character_length, 8, 0 + )); + } + + // return the build + return $component; + } + + return false; + } +} + diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power new file mode 100644 index 0000000..248d323 --- /dev/null +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power @@ -0,0 +1,667 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The Name Class. + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldname; + + /** + * The TypeName Class. + * + * @var TypeName + * @since 3.2.0 + */ + protected TypeName $typename; + + /** + * The Counter Class. + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The AssetsRules Class. + * + * @var AssetsRules + * @since 3.2.0 + */ + protected AssetsRules $assetsrules; + + /** + * The CustomTabs Class. + * + * @var CustomTabs + * @since 3.2.0 + */ + protected CustomTabs $customtabs; + + /** + * The PermissionViews Class. + * + * @var PermissionViews + * @since 3.2.0 + */ + protected PermissionViews $permissionviews; + + /** + * The PermissionFields Class. + * + * @var PermissionFields + * @since 3.2.0 + */ + protected PermissionFields $permissionfields; + + /** + * The PermissionComponent Class. + * + * @var PermissionComponent + * @since 3.2.0 + */ + protected PermissionComponent $permissioncomponent; + + /** + * The CustomButtonPermissions Class. + * + * @var CustomButtonPermissions + * @since 3.2.0 + */ + protected CustomButtonPermissions $custombuttonpermissions; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param FieldName $fieldname The Name Class. + * @param TypeName $typename The TypeName Class. + * @param Counter $counter The Counter Class. + * @param Permission $permission The Permission Class. + * @param AssetsRules $assetsrules The AssetsRules Class. + * @param CustomTabs $customtabs The CustomTabs Class. + * @param PermissionViews $permissionviews The PermissionViews Class. + * @param PermissionFields $permissionfields The PermissionFields Class. + * @param PermissionComponent $permissioncomponent The PermissionComponent Class. + * @param CustomButtonPermissions $custombuttonpermissions The CustomButtonPermissions Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Language $language, + Component $component, FieldName $fieldname, + TypeName $typename, Counter $counter, + Permission $permission, AssetsRules $assetsrules, + CustomTabs $customtabs, PermissionViews $permissionviews, + PermissionFields $permissionfields, + PermissionComponent $permissioncomponent, + CustomButtonPermissions $custombuttonpermissions) + { + $this->config = $config; + $this->event = $event; + $this->language = $language; + $this->component = $component; + $this->fieldname = $fieldname; + $this->typename = $typename; + $this->counter = $counter; + $this->permission = $permission; + $this->assetsrules = $assetsrules; + $this->customtabs = $customtabs; + $this->permissionviews = $permissionviews; + $this->permissionfields = $permissionfields; + $this->permissioncomponent = $permissioncomponent; + $this->custombuttonpermissions = $custombuttonpermissions; + } + + /** + * Get Access Sections + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + // access size counter + $this->counter->accessSize = 12; // ;) + + // Trigger Event: jcb_ce_onBeforeBuildAccessSections + $this->event->trigger( + 'jcb_ce_onBeforeBuildAccessSections' + ); + + // Get the default fields + $default_fields = $this->config->default_fields; + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.admin', + 'title' => 'JACTION_ADMIN', + 'description' => 'JACTION_ADMIN_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.options', + 'title' => 'JACTION_OPTIONS', + 'description' => 'JACTION_OPTIONS_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.manage', + 'title' => 'JACTION_MANAGE', + 'description' => 'JACTION_MANAGE_COMPONENT_DESC' + ], true); + + if ($this->config->get('add_eximport', false)) + { + $exportTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Export Data', 'U'); + $exportDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Export Data', 'U') + . '_DESC'; + $this->language->set('bothadmin', $exportTitle, 'Export Data'); + $this->language->set( + 'bothadmin', $exportDesc, + ' Allows users in this group to export data.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.export', + 'title' => $exportTitle, + 'description' => $exportDesc + ], true); + + // the size needs increase + $this->counter->accessSize++; + $importTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Import Data', 'U'); + $importDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Import Data', 'U') + . '_DESC'; + $this->language->set('bothadmin', $importTitle, 'Import Data'); + $this->language->set( + 'bothadmin', $importDesc, + ' Allows users in this group to import data.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.import', + 'title' => $importTitle, + 'description' => $importDesc + ], true); + + // the size needs increase + $this->counter->accessSize++; + } + + // version permission + $batchTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Use Batch', 'U'); + $batchDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Use Batch', 'U') . '_DESC'; + $this->language->set('bothadmin', $batchTitle, 'Use Batch'); + $this->language->set( + 'bothadmin', $batchDesc, + ' Allows users in this group to use batch copy/update method.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.batch', + 'title' => $batchTitle, + 'description' => $batchDesc + ], true); + + // version permission + $importTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Versions', 'U'); + $importDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Versions', 'U') + . '_DESC'; + $this->language->set('bothadmin', $importTitle, 'Edit Version'); + $this->language->set( + 'bothadmin', $importDesc, + ' Allows users in this group to edit versions.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.version', + 'title' => $importTitle, + 'description' => $importDesc + ], true); + + // set the defaults + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.create', + 'title' => 'JACTION_CREATE', + 'description' => 'JACTION_CREATE_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.delete', + 'title' => 'JACTION_DELETE', + 'description' => 'JACTION_DELETE_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit', + 'title' => 'JACTION_EDIT', + 'description' => 'JACTION_EDIT_COMPONENT_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.state', + 'title' => 'JACTION_EDITSTATE', + 'description' => 'JACTION_ACCESS_EDITSTATE_DESC' + ], true); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.own', + 'title' => 'JACTION_EDITOWN', + 'description' => 'JACTION_EDITOWN_COMPONENT_DESC' + ], true); + + // set the Joomla fields + if ($this->config->get('set_joomla_fields', false)) + { + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.value', + 'title' => 'JACTION_EDITVALUE', + 'description' => 'JACTION_EDITVALUE_COMPONENT_DESC' + ], true); + + // the size needs increase + $this->counter->accessSize++; + } + + // new custom created by permissions + $created_byTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created By', 'U'); + $created_byDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created By', 'U') + . '_DESC'; + $this->language->set('bothadmin', $created_byTitle, 'Edit Created By'); + $this->language->set( + 'bothadmin', $created_byDesc, + ' Allows users in this group to edit created by.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.created_by', + 'title' => $created_byTitle, + 'description' => $created_byDesc + ], true); + + // new custom created date permissions + $createdTitle = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created Date', 'U'); + $createdDesc = $this->config->lang_prefix . '_' + . StringHelper::safe('Edit Created Date', 'U') + . '_DESC'; + $this->language->set('bothadmin', $createdTitle, 'Edit Created Date'); + $this->language->set( + 'bothadmin', $createdDesc, + ' Allows users in this group to edit created date.' + ); + $this->permissioncomponent->add('->HEAD<-', [ + 'name' => 'core.edit.created', + 'title' => $createdTitle, + 'description' => $createdDesc + ], true); + + // set the menu controller lookup + $menuControllers = ['access', 'submenu', 'dashboard_list', 'dashboard_add']; + + // set the custom admin views permissions + if ($this->component->isArray('custom_admin_views')) + { + foreach ($this->component->get('custom_admin_views') as $custom_admin_view) + { + // new custom permissions to access this view + $customAdminName = $custom_admin_view['settings']->name; + $customAdminCode = $custom_admin_view['settings']->code; + $customAdminTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $customAdminName . ' Access', 'U' + ); + $customAdminDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $customAdminName . ' Access', 'U' + ) . '_DESC'; + $sortKey = StringHelper::safe( + $customAdminName . ' Access' + ); + $this->language->set( + 'bothadmin', $customAdminTitle, $customAdminName . ' Access' + ); + $this->language->set( + 'bothadmin', $customAdminDesc, + ' Allows the users in this group to access ' + . StringHelper::safe($customAdminName, 'w') + . '.' + ); + $this->permissioncomponent->set($sortKey, [ + 'name' => "$customAdminCode.access", + 'title' => $customAdminTitle, + 'description' => $customAdminDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $custom_admin_view['settings'], $customAdminName, + $customAdminCode + ); + + // add menu controll view that has menus options + foreach ($menuControllers as $menuController) + { + // add menu controll view that has menus options + if (isset($custom_admin_view[$menuController]) + && $custom_admin_view[$menuController]) + { + $targetView_ = 'views.'; + if ($menuController === 'dashboard_add') + { + $targetView_ = 'view.'; + } + + // menucontroller + $menucontrollerView['action'] = $targetView_ + . $menuController; + $menucontrollerView['implementation'] = '2'; + if (isset($custom_admin_view['settings']->permissions) + && ArrayHelper::check( + $custom_admin_view['settings']->permissions + )) + { + array_push( + $custom_admin_view['settings']->permissions, + $menucontrollerView + ); + } + else + { + $custom_admin_view['settings']->permissions + = []; + $custom_admin_view['settings']->permissions[] + = $menucontrollerView; + } + unset($menucontrollerView); + } + } + + $this->permission ->set( + $custom_admin_view, $customAdminCode, $customAdminCode, + $menuControllers, 'customAdmin' + ); + } + } + + // set the site views permissions + if ($this->component->isArray('site_views')) + { + foreach ($this->component->get('site_views') as $site_view) + { + // new custom permissions to access this view + $siteName = $site_view['settings']->name; + $siteCode = $site_view['settings']->code; + $siteTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $siteName . ' Access Site', 'U' + ); + $siteDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $siteName . ' Access Site', 'U' + ) . '_DESC'; + $sortKey = StringHelper::safe( + $siteName . ' Access Site' + ); + + if (isset($site_view['access']) && $site_view['access'] == 1) + { + $this->language->set( + 'bothadmin', $siteTitle, $siteName . ' (Site) Access' + ); + $this->language->set( + 'bothadmin', $siteDesc, + ' Allows the users in this group to access site ' + . StringHelper::safe($siteName, 'w') + . '.' + ); + $this->permissioncomponent->set($sortKey, [ + 'name' => "site.$siteCode.access", + 'title' => $siteTitle, + 'description' => $siteDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + + // check if this site view requires access rule to default to public + if (isset($site_view['public_access']) + && $site_view['public_access'] == 1) + { + // we use one as public group (TODO we see if we run into any issues) + $this->assetsrules->add('site', '"site.' . $siteCode + . '.access":{"1":1}'); + } + } + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $site_view['settings'], $siteName, $siteCode + ); + } + } + + if ($this->component->isArray('admin_views')) + { + foreach ($this->component->get('admin_views') as $view) + { + // set view name + $nameView = StringHelper::safe( + $view['settings']->name_single + ); + $nameViews = StringHelper::safe( + $view['settings']->name_list + ); + + // add custom tab permissions if found + if (($tabs_ = $this->customtabs->get($nameView)) !== null + && ArrayHelper::check($tabs_)) + { + foreach ($tabs_ as $_customTab) + { + if (isset($_customTab['permission']) + && $_customTab['permission'] == 1) + { + $this->permissioncomponent->set($_customTab['sortKey'], [ + 'name' => $_customTab['view'] . '.' . $_customTab['code'] . '.viewtab', + 'title' => $_customTab['lang_permission'], + 'description' => $_customTab['lang_permission_desc'] + ]); + + // the size needs increase + $this->counter->accessSize++; + } + } + } + + // add the custom permissions to use the buttons of this view + $this->custombuttonpermissions->add( + $view['settings'], $view['settings']->name_single, $nameView + ); + + if ($nameView != 'component') + { + // add menu controll view that has menus options + foreach ($menuControllers as $menuController) + { + // add menu controll view that has menus options + if (isset($view[$menuController]) + && $view[$menuController]) + { + $targetView_ = 'views.'; + if ($menuController === 'dashboard_add') + { + $targetView_ = 'view.'; + } + // menucontroller + $menucontrollerView['action'] = $targetView_ . $menuController; + $menucontrollerView['implementation'] = '2'; + if (isset($view['settings']->permissions) + && ArrayHelper::check( + $view['settings']->permissions + )) + { + array_push( + $view['settings']->permissions, + $menucontrollerView + ); + } + else + { + $view['settings']->permissions = []; + $view['settings']->permissions[] = $menucontrollerView; + } + unset($menucontrollerView); + } + } + + // check if there are fields + if (ArrayHelper::check($view['settings']->fields)) + { + // field permission options + $permission_options = [1 => 'edit', 2 => 'access', 3 => 'view']; + + // check the fields for their permission settings + foreach ($view['settings']->fields as $field) + { + // see if field require permissions to be set + if (isset($field['permission']) + && ArrayHelper::check( + $field['permission'] + )) + { + if (ArrayHelper::check( + $field['settings']->properties + )) + { + $fieldType = $this->typename->get($field); + $fieldName = $this->fieldname->get( + $field, $nameViews + ); + + // loop the permission options + foreach ($field['permission'] as $permission_id) + { + // set the permission key word + $permission_option = $permission_options[(int) $permission_id]; + + // reset the bucket + $fieldView = []; + + // set the permission for this field + $fieldView['action'] = 'view.' . $permission_option . '.' . $fieldName; + $fieldView['implementation'] = '3'; + + // check if persmissions was already set + if (isset($view['settings']->permissions) + && ArrayHelper::check( + $view['settings']->permissions + )) + { + array_push($view['settings']->permissions, $fieldView); + } + else + { + $view['settings']->permissions = []; + $view['settings']->permissions[] = $fieldView; + } + + // ensure that no default field get loaded + if (!in_array($fieldName, $default_fields)) + { + // load to global field permission set + $this->permissionfields-> + set("$nameView.$fieldName.$permission_option", $fieldType); + } + } + } + } + } + } + $this->permission ->set( + $view, $nameView, $nameViews, $menuControllers + ); + } + } + + // Trigger Event: jcb_ce_onAfterBuildAccessSections + $this->event->trigger( + 'jcb_ce_onAfterBuildAccessSections' + ); + + /// now build the section + $component = $this->permissioncomponent->build(); + + // add views to the component section + $component .= $this->permissionviews->build(); + + // remove the fix, is not needed + if ($this->counter->accessSize < 30) + { + // since we have less than 30 actions + // we do not need the fix for this component + $this->config->set('add_assets_table_fix', 0); + } + else + { + // get the worst case column size required (can be worse I know) + // access/action size x 20 characters x 8 groups + $character_length = (int) MathHelper::bc( + 'mul', $this->counter->accessSize, 20, 0 + ); + + // set worse case + $this->config->set('access_worse_case', (int) MathHelper::bc( + 'mul', $character_length, 8, 0 + )); + } + + // return the build + return $component; + } + + return false; + } \ No newline at end of file diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json new file mode 100644 index 0000000..4911c26 --- /dev/null +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json @@ -0,0 +1,87 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "15615db0-02b9-454f-a82e-1ab39ae5e6a9", + "implements": null, + "load_selection": null, + "name": "AccessSections", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.AccessSections", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection2": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection3": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection4": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection5": { + "use": "eb33420d-359d-44a5-852e-613aef1feaae", + "as": "default" + }, + "use_selection6": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection7": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection8": { + "use": "9b5872d6-c1d8-4602-b443-5844d2c950ee", + "as": "default" + }, + "use_selection9": { + "use": "9551b683-67b6-4367-bb14-4b016def37e3", + "as": "default" + }, + "use_selection10": { + "use": "480d11b9-783b-45d5-bce1-b0c2fcaad08a", + "as": "default" + }, + "use_selection11": { + "use": "5133a033-1351-43ec-9692-2907d7b9aacd", + "as": "default" + }, + "use_selection12": { + "use": "94f4939f-82cc-4196-802b-1346ce5c7f99", + "as": "default" + }, + "use_selection13": { + "use": "8bf026e7-9ae0-423c-b74b-5bc16c54acf7", + "as": "default" + }, + "use_selection14": { + "use": "152c8793-8b75-4715-996a-257b9f65451c", + "as": "default" + }, + "use_selection15": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection16": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.AccessSections", + "description": "Access Sections Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php index dca3671..4d818fd 100644 --- a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php @@ -96,9 +96,13 @@ class Historycomponent */ private function setAdminView(object $item) { - $old_admin_views = $this->history->get( - 'component_admin_views', $item->addadmin_views_id - ); + $old_admin_views = null; + if (isset($item->addadmin_views_id)) + { + $old_admin_views = $this->history->get( + 'component_admin_views', $item->addadmin_views_id + ); + } // add new views if found if ($old_admin_views && ObjectHelper::check($old_admin_views)) @@ -126,9 +130,13 @@ class Historycomponent */ private function setComponent(object &$item) { - $old_component = $this->history->get( - 'joomla_component', $this->config->component_id - ); + $old_component = null; + if (isset($this->config->component_id)) + { + $old_component = $this->history->get( + 'joomla_component', $this->config->component_id + ); + } // check if a new version was manually set if ($old_component && ObjectHelper::check($old_component)) diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power index 65ca78a..cc3ba66 100644 --- a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power @@ -66,9 +66,13 @@ */ private function setAdminView(object $item) { - $old_admin_views = $this->history->get( - 'component_admin_views', $item->addadmin_views_id - ); + $old_admin_views = null; + if (isset($item->addadmin_views_id)) + { + $old_admin_views = $this->history->get( + 'component_admin_views', $item->addadmin_views_id + ); + } // add new views if found if ($old_admin_views && ObjectHelper::check($old_admin_views)) @@ -96,9 +100,13 @@ */ private function setComponent(object &$item) { - $old_component = $this->history->get( - 'joomla_component', $this->config->component_id - ); + $old_component = null; + if (isset($this->config->component_id)) + { + $old_component = $this->history->get( + 'joomla_component', $this->config->component_id + ); + } // check if a new version was manually set if ($old_component && ObjectHelper::check($old_component)) diff --git a/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md new file mode 100644 index 0000000..7f62262 --- /dev/null +++ b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class InputButton (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour** +```uml +@startuml +class InputButton << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Placeholder $placeholder + # Permission $permission + + __construct(Config $config, Placeholder $placeholder, ...) + + get(array $fieldData) : string +} + +note right of InputButton::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Placeholder $placeholder + Permission $permission +end note + +note right of InputButton::get + get Add Button To List Field Input (getInput tweak) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php new file mode 100644 index 0000000..fe58464 --- /dev/null +++ b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php @@ -0,0 +1,345 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface; + + +/** + * Compiler Field Input Button + * + * @since 3.2.0 + */ +final class InputButton implements InputButtonInterface +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Permission $permission) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->permission = $permission; + } + + /** + * get Add Button To List Field Input (getInput tweak) + * + * @param array $fieldData The field custom data + * + * @return string of getInput class on success empty string otherwise + * @since 3.2.0 + */ + public function get(array $fieldData): string + { + // make sure hte view values are set + if (isset($fieldData['add_button']) + && ($fieldData['add_button'] === 'true' + || 1 == $fieldData['add_button']) + && isset($fieldData['view']) + && isset($fieldData['views']) + && StringHelper::check($fieldData['view']) + && StringHelper::check($fieldData['views'])) + { + // set local component + $local_component = "com_" . $this->config->component_code_name; + // check that the component value is set + if (!isset($fieldData['component']) + || !StringHelper::check( + $fieldData['component'] + )) + { + $fieldData['component'] = $local_component; + } + // check that the component has the com_ value in it + if (strpos((string) $fieldData['component'], 'com_') === false + || strpos((string) $fieldData['component'], '=') !== false) + { + $fieldData['component'] = "com_" . $fieldData['component']; + } + // make sure the component is update if # # # or [ [ [ component placeholder is used + if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false + || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but + { + $fieldData['component'] = $this->placeholder->update_( + $fieldData['component'] + ); + } + // get core permissions + $coreLoad = false; + // add ref tags + $refLoad = true; + // fall back on the field component + $component = $fieldData['component']; + // check if we should add ref tags (since it only works well on local views) + if ($local_component !== $component) + { + // do not add ref tags + $refLoad = false; + } + // start building the add buttons/s + $addButton = array(); + $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addButton[] = Indent::_(1) . " * Override to add new button"; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) + . " * @return string The field input markup."; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @since 3.2"; + $addButton[] = Indent::_(1) . " */"; + $addButton[] = Indent::_(1) . "protected function getInput()"; + $addButton[] = Indent::_(1) . "{"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " see if we should add buttons"; + $addButton[] = Indent::_(2) + . "\$set_button = \$this->getAttribute('button');"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get html"; + $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " if true set button"; + $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; + $addButton[] = Indent::_(2) . "{"; + $addButton[] = Indent::_(3) . "\$button = array();"; + $addButton[] = Indent::_(3) . "\$script = array();"; + $addButton[] = Indent::_(3) + . "\$button_code_name = \$this->getAttribute('name');"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the input from url"; + $addButton[] = Indent::_(3) . "\$app = Factory::getApplication();"; + $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the view name & id"; + $addButton[] = Indent::_(3) + . "\$values = \$jinput->getArray(array("; + $addButton[] = Indent::_(4) . "'id' => 'int',"; + $addButton[] = Indent::_(4) . "'view' => 'word'"; + $addButton[] = Indent::_(3) . "));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if new item"; + $addButton[] = Indent::_(3) . "\$ref = '';"; + $addButton[] = Indent::_(3) . "\$refJ = '';"; + if ($refLoad) + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load referral if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref .= '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ .= '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + else + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load field details if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref = '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ = '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get button label"; + $addButton[] = Indent::_(3) + . "\$button_label = trim(\$button_code_name);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = ucfirst(strtolower(\$button_label));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get user object"; + $addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to create " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.create') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build Create button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to edit " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.edit') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build edit button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build script"; +$addButton[] = Indent::_(4) . "\$script[] = \""; + $addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {"; + $addButton[] = Indent::_(6) + . "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {"; + $addButton[] = Indent::_(7) . "e.preventDefault();"; + $addButton[] = Indent::_(7) + . "let \".\$button_code_name.\"Value = this.value;"; + $addButton[] = Indent::_(7) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(6) . "});"; + $addButton[] = Indent::_(6) + . "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;"; + $addButton[] = Indent::_(6) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(5) . "});"; + $addButton[] = Indent::_(5) + . "function \".\$button_code_name.\"Button(value) {"; + $addButton[] = Indent::_(6) + . "var createButton = document.getElementById('\".\$button_code_name.\"Create');"; + $addButton[] = Indent::_(6) + . "var editButton = document.getElementById('\".\$button_code_name.\"Edit');"; + $addButton[] = Indent::_(6) + . "if (value > 0) {"; // TODO not ideal since value may not be an (int) + $addButton[] = Indent::_(7) . "// hide the create button"; + $addButton[] = Indent::_(7) + . "createButton.style.display = 'none';"; + $addButton[] = Indent::_(7) . "// show edit button"; + $addButton[] = Indent::_(7) + . "editButton.style.display = 'block';"; + $addButton[] = Indent::_(7) . "let url = 'index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['views'] + . "&task=" . $fieldData['view'] + . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = Indent::_(7) + . "editButton.setAttribute('href', url);"; + $addButton[] = Indent::_(6) . "} else {"; + $addButton[] = Indent::_(7) . "// show the create button"; + $addButton[] = Indent::_(7) + . "createButton.style.display = 'block';"; + $addButton[] = Indent::_(7) . "// hide edit button"; + $addButton[] = Indent::_(7) + . "editButton.style.display = 'none';"; + $addButton[] = Indent::_(6) . "}"; + $addButton[] = Indent::_(5) . "}\";"; + + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if button was created for " . $fieldData['view'] + . " field."; + $addButton[] = Indent::_(3) + . "if (is_array(\$button) && count(\$button) > 0)"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " Load the needed script."; + $addButton[] = Indent::_(4) + . "\$document = Factory::getApplication()->getDocument();"; + $addButton[] = Indent::_(4) + . "\$document->addScriptDeclaration(implode(' ',\$script));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " return the button attached to input field."; + $addButton[] = Indent::_(4) + . "return '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } +} + diff --git a/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power new file mode 100644 index 0000000..27cbb01 --- /dev/null +++ b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power @@ -0,0 +1,312 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Permission $permission) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->permission = $permission; + } + + /** + * get Add Button To List Field Input (getInput tweak) + * + * @param array $fieldData The field custom data + * + * @return string of getInput class on success empty string otherwise + * @since 3.2.0 + */ + public function get(array $fieldData): string + { + // make sure hte view values are set + if (isset($fieldData['add_button']) + && ($fieldData['add_button'] === 'true' + || 1 == $fieldData['add_button']) + && isset($fieldData['view']) + && isset($fieldData['views']) + && StringHelper::check($fieldData['view']) + && StringHelper::check($fieldData['views'])) + { + // set local component + $local_component = "com_" . $this->config->component_code_name; + // check that the component value is set + if (!isset($fieldData['component']) + || !StringHelper::check( + $fieldData['component'] + )) + { + $fieldData['component'] = $local_component; + } + // check that the component has the com_ value in it + if (strpos((string) $fieldData['component'], 'com_') === false + || strpos((string) $fieldData['component'], '=') !== false) + { + $fieldData['component'] = "com_" . $fieldData['component']; + } + // make sure the component is update if # # # or [ [ [ component placeholder is used + if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false + || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but + { + $fieldData['component'] = $this->placeholder->update_( + $fieldData['component'] + ); + } + // get core permissions + $coreLoad = false; + // add ref tags + $refLoad = true; + // fall back on the field component + $component = $fieldData['component']; + // check if we should add ref tags (since it only works well on local views) + if ($local_component !== $component) + { + // do not add ref tags + $refLoad = false; + } + // start building the add buttons/s + $addButton = array(); + $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addButton[] = Indent::_(1) . " * Override to add new button"; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) + . " * @return string The field input markup."; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @since 3.2"; + $addButton[] = Indent::_(1) . " */"; + $addButton[] = Indent::_(1) . "protected function getInput()"; + $addButton[] = Indent::_(1) . "{"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " see if we should add buttons"; + $addButton[] = Indent::_(2) + . "\$set_button = \$this->getAttribute('button');"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get html"; + $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " if true set button"; + $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; + $addButton[] = Indent::_(2) . "{"; + $addButton[] = Indent::_(3) . "\$button = array();"; + $addButton[] = Indent::_(3) . "\$script = array();"; + $addButton[] = Indent::_(3) + . "\$button_code_name = \$this->getAttribute('name');"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the input from url"; + $addButton[] = Indent::_(3) . "\$app = Factory::getApplication();"; + $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the view name & id"; + $addButton[] = Indent::_(3) + . "\$values = \$jinput->getArray(array("; + $addButton[] = Indent::_(4) . "'id' => 'int',"; + $addButton[] = Indent::_(4) . "'view' => 'word'"; + $addButton[] = Indent::_(3) . "));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if new item"; + $addButton[] = Indent::_(3) . "\$ref = '';"; + $addButton[] = Indent::_(3) . "\$refJ = '';"; + if ($refLoad) + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load referral if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref .= '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ .= '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + else + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load field details if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref = '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ = '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get button label"; + $addButton[] = Indent::_(3) + . "\$button_label = trim(\$button_code_name);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = ucfirst(strtolower(\$button_label));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get user object"; + $addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to create " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.create') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build Create button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to edit " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.edit') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build edit button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build script"; +$addButton[] = Indent::_(4) . "\$script[] = \""; + $addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {"; + $addButton[] = Indent::_(6) + . "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {"; + $addButton[] = Indent::_(7) . "e.preventDefault();"; + $addButton[] = Indent::_(7) + . "let \".\$button_code_name.\"Value = this.value;"; + $addButton[] = Indent::_(7) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(6) . "});"; + $addButton[] = Indent::_(6) + . "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;"; + $addButton[] = Indent::_(6) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(5) . "});"; + $addButton[] = Indent::_(5) + . "function \".\$button_code_name.\"Button(value) {"; + $addButton[] = Indent::_(6) + . "var createButton = document.getElementById('\".\$button_code_name.\"Create');"; + $addButton[] = Indent::_(6) + . "var editButton = document.getElementById('\".\$button_code_name.\"Edit');"; + $addButton[] = Indent::_(6) + . "if (value > 0) {"; // TODO not ideal since value may not be an (int) + $addButton[] = Indent::_(7) . "// hide the create button"; + $addButton[] = Indent::_(7) + . "createButton.style.display = 'none';"; + $addButton[] = Indent::_(7) . "// show edit button"; + $addButton[] = Indent::_(7) + . "editButton.style.display = 'block';"; + $addButton[] = Indent::_(7) . "let url = 'index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['views'] + . "&task=" . $fieldData['view'] + . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = Indent::_(7) + . "editButton.setAttribute('href', url);"; + $addButton[] = Indent::_(6) . "} else {"; + $addButton[] = Indent::_(7) . "// show the create button"; + $addButton[] = Indent::_(7) + . "createButton.style.display = 'block';"; + $addButton[] = Indent::_(7) . "// hide edit button"; + $addButton[] = Indent::_(7) + . "editButton.style.display = 'none';"; + $addButton[] = Indent::_(6) . "}"; + $addButton[] = Indent::_(5) . "}\";"; + + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if button was created for " . $fieldData['view'] + . " field."; + $addButton[] = Indent::_(3) + . "if (is_array(\$button) && count(\$button) > 0)"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " Load the needed script."; + $addButton[] = Indent::_(4) + . "\$document = Factory::getApplication()->getDocument();"; + $addButton[] = Indent::_(4) + . "\$document->addScriptDeclaration(implode(' ',\$script));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " return the button attached to input field."; + $addButton[] = Indent::_(4) + . "return '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } \ No newline at end of file diff --git a/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json new file mode 100644 index 0000000..a672ed0 --- /dev/null +++ b/src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe", + "implements": [ + "c600f58c-3fe2-4d2d-b711-2660eab6effe" + ], + "load_selection": null, + "name": "InputButton", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J4.InputButton", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection2": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFour.InputButton", + "description": "Compiler Field Input Button\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md index f16fca1..943ae79 100644 --- a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md @@ -14,8 +14,8 @@ class Gui #Gold { # Config $config # Reverse $reverse # Parser $parser - # \JDatabaseDriver $db - # CMSApplication $app + # $db + # $app + __construct(?Config $config = null, ?Reverse $reverse = null, ...) + set(string $string, array $config) : string + search(string $file, array $placeholders, ...) : void @@ -31,8 +31,6 @@ note right of Gui::__construct ?Config $config = null ?Reverse $reverse = null ?Parser $parser = null - ?\JDatabaseDriver $db = null - ?CMSApplication $app = null end note note right of Gui::set diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php index 36553af..9398251 100644 --- a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php @@ -61,18 +61,16 @@ class Gui implements GuiInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -80,20 +78,17 @@ class Gui implements GuiInterface * @param Config|null $config The compiler config object. * @param Reverse|null $reverse The compiler placeholder reverse object. * @param Parser|null $parser The powers parser object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ - public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null) { $this->config = $config ?: Compiler::_('Config'); $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); $this->parser = $parser ?: Compiler::_('Power.Parser'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.power b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.power index 9cdd19a..d89a7a0 100644 --- a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.power +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.power @@ -25,18 +25,16 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -44,20 +42,17 @@ * @param Config|null $config The compiler config object. * @param Reverse|null $reverse The compiler placeholder reverse object. * @param Parser|null $parser The powers parser object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ - public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null) { $this->config = $config ?: Compiler::_('Config'); $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); $this->parser = $parser ?: Compiler::_('Power.Parser'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md index a440882..4bed7ec 100644 --- a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md @@ -14,10 +14,10 @@ class External #Gold { # array $code # array $cutter # Placeholder $placeholder - # \JDatabaseDriver $db - # User $user - # CMSApplication $app - + __construct(?Placeholder $placeholder = null, ?\JDatabaseDriver $db = null, ...) + # $db + # $user + # $app + + __construct(?Placeholder $placeholder = null) + set(string $string, int $debug) : string # getCode(string $target, array $bucket) : void # cut(string $string, string $sequence, ...) : string @@ -27,12 +27,6 @@ note right of External::__construct Constructor. since: 3.2.0 - - arguments: - ?Placeholder $placeholder = null - ?\JDatabaseDriver $db = null - ?User $user = null - ?CMSApplication $app = null end note note right of External::set diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php index 1b8acfc..c3d6772 100644 --- a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php @@ -60,45 +60,38 @@ class External implements ExternalInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * User object * - * @var User * @since 3.2.0 **/ - protected User $user; + protected $user; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. * * @param Placeholder|null $placeholder The compiler placeholder object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param User|null $user The User object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ - public function __construct(?Placeholder $placeholder = null, - ?\JDatabaseDriver $db = null, ?User $user = null, ?CMSApplication $app = null) + public function __construct(?Placeholder $placeholder = null) { $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); - $this->db = $db ?: Factory::getDbo(); - $this->user = $user ?: Factory::getUser(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->user = Factory::getUser(); + $this->app = Factory::getApplication(); } /** diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.power b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.power index b1ccd03..1729c34 100644 --- a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.power +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.power @@ -25,45 +25,38 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * User object * - * @var User * @since 3.2.0 **/ - protected User $user; + protected $user; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. * * @param Placeholder|null $placeholder The compiler placeholder object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param User|null $user The User object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ - public function __construct(?Placeholder $placeholder = null, - ?\JDatabaseDriver $db = null, ?User $user = null, ?CMSApplication $app = null) + public function __construct(?Placeholder $placeholder = null) { $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); - $this->db = $db ?: Factory::getDbo(); - $this->user = $user ?: Factory::getUser(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->user = Factory::getUser(); + $this->app = Factory::getApplication(); } /** diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php index 3e34d41..eb3f69e 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php @@ -207,7 +207,11 @@ class InstallScript implements GetScriptInterface $extension = $this->extension; // start build - $script = PHP_EOL . '/**'; + $script = PHP_EOL . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; $script .= PHP_EOL . ' * ' . $extension->official_name . ' script file.'; $script .= PHP_EOL . ' *'; @@ -325,7 +329,7 @@ class InstallScript implements GetScriptInterface $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' get application'; $script .= PHP_EOL . Indent::_(2) - . '$app = JFactory::getApplication();' . PHP_EOL; + . '$app = Factory::getApplication();' . PHP_EOL; // add the default version check (TODO) must make this dynamic if ('preflight' === $name) diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power index 89c3249..7946c5a 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power @@ -178,7 +178,11 @@ $extension = $this->extension; // start build - $script = PHP_EOL . '/**'; + $script = PHP_EOL . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; $script .= PHP_EOL . ' * ' . $extension->official_name . ' script file.'; $script .= PHP_EOL . ' *'; @@ -296,7 +300,7 @@ $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' get application'; $script .= PHP_EOL . Indent::_(2) - . '$app = JFactory::getApplication();' . PHP_EOL; + . '$app = Factory::getApplication();' . PHP_EOL; // add the default version check (TODO) must make this dynamic if ('preflight' === $name) diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md new file mode 100644 index 0000000..1f83a5e --- /dev/null +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md @@ -0,0 +1,94 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Header (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour** +```uml +@startuml +class Header << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Event $event + # Placeholder $placeholder + # Language $language + # UikitComp $uikitcomp + # AdminFilterType $adminfiltertype + # Category $category + # AccessSwitchList $accessswitchlist + # Filter $filter + # Tags $tags + # array $headers + # string $NamespacePrefix + # string $ComponentName + # string $ComponentNameSpace + + __construct(Config $config, Event $event, ...) + + get(string $context, string $codeName) : string + # getHeaders(string $context) : array + # setHelperClassHeader(array $headers, string $target_client) : void + # setChosenMultiSelectionHeaders(array $headers, string $nameListCode) : void +} + +note right of Header::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Event $event + Placeholder $placeholder + Language $language + UikitComp $uikitcomp + AdminFilterType $adminfiltertype + Category $category + AccessSwitchList $accessswitchlist + Filter $filter + Tags $tags +end note + +note right of Header::get + Get the headers for a file + + since: 3.2.0 + return: string +end note + +note right of Header::getHeaders + Get the headers for a file + + since: 3.2.0 + return: array +end note + +note right of Header::setHelperClassHeader + set Helper Dynamic Headers + + since: 3.2.0 + return: void +end note + +note right of Header::setChosenMultiSelectionHeaders + Build chosen multi selection headers for the view + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php new file mode 100644 index 0000000..de0e098 --- /dev/null +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php @@ -0,0 +1,643 @@ + + * @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\JoomlaFour; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; + + +/** + * Build headers for all Joomla 4 files + * + * @since 3.2.0 + */ +final class Header implements HeaderInterface +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * The Namespace Prefix + * + * @var string + * @since 3.2.0 + */ + protected string $NamespacePrefix; + + /** + * The Component Name (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentName; + + /** + * The Component Namespace (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentNameSpace; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + + // set some global values + $this->NamespacePrefix = $this->config->get('namespace_prefix'); + $this->ComponentName = $this->placeholder->get('Component'); + $this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // get static headers + $headers = $this->getHeaders($context); + + // get dynamic headers + switch ($context) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + case 'admin.views': + $this->setChosenMultiSelectionHeaders($headers, $codeName); + break; + + case 'admin.view.model': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // add to all except the helper classes + if ('admin.helper' !== $context && 'site.helper' !== $context) + { + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;"; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Database\DatabaseInterface;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = ''; + $headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */'; + $headers[] = '$wa = $this->getDocument()->getWebAssetManager();'; + $headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');'; + $headers[] = 'Html::_(\'bootstrap.tooltip\');'; + break; + + case 'admin.view.controller': + $headers[] = 'use Joomla\CMS\Form\FormFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Application\CMSApplication;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\Input\Input;'; + case 'site.admin.view.controller': + $headers[] = 'use Joomla\CMS\Versioning\VersionableControllerTrait;'; + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;"; + break; + + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;"; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Form;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\CMS\Versioning\VersionableModelTrait;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + break; + + case 'dashboard.model': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + case 'admin.views.model': + case 'ajax.admin.model': + case 'ajax.site.model': + case 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ListModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Input\Input;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.component': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'site.view': + case 'site.views': + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'form.custom.field': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Field\###FORM_EXTENDS###;'; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } + + /** + * Build chosen multi selection headers for the view + * + * @param array $headers The headers array + * @param string $nameListCode The list view name + * + * @return void + * @since 3.2.0 + */ + protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode) + { + // check that the filter type is the new filter option (2 = topbar) + if ($this->adminfiltertype->get($nameListCode, 1) == 2) + { + // add category switch + $add_category = false; + if ($this->category->exists("{$nameListCode}.extension") + && $this->category->get("{$nameListCode}.filter", 0) >= 1) + { + // is found so add it + $add_category = true; + } + // add accessLevels switch + $add_access_levels = false; + if ($this->accessswitchlist->exists($nameListCode)) + { + // is found so add it + $add_access_levels = true; + } + // check if this view have filters + if ($this->filter->exists($nameListCode)) + { + foreach ($this->filter->get($nameListCode) as $filter) + { + // we need this only for filters that are multi + if (isset($filter['multi']) && $filter['multi'] == 2) + { + // if this is a category we should make sure it must be added + if (!$add_category && $filter['type'] === 'category') + { + continue; + } + elseif ($add_category && $filter['type'] === 'category') + { + // already added here so no need to add again + $add_category = false; + } + // check if this was an access field + elseif ($filter['type'] === 'accesslevel') + { + // already added here so no need to add again + $add_access_levels = false; + } + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multiple' + . $filter['class'] + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + } + elseif ($add_category && $filter['type'] === 'category') + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + // already added here so no need to add again + $add_category = false; + } + } + } + // add category if not already added + if ($add_category) + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $this->category->exists("{$nameListCode}.name", 'error') + . '\') . \' -\']);'; + } + // add accessLevels if not already added + if ($add_access_levels) + { + // set the language strings for selection + $filter_name_select = 'Select Access'; + $filter_name_select_lang = $this->config->lang_prefix . '_FILTER_' + . StringHelper::safe( + $filter_name_select, 'U' + ); + // and to translation + $this->language->set( + $this->config->lang_target, $filter_name_select_lang, $filter_name_select + ); + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter_name_select_lang . '\') . \' -\']);'; + } + } + } +} + diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power new file mode 100644 index 0000000..3bf4342 --- /dev/null +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power @@ -0,0 +1,604 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * The Namespace Prefix + * + * @var string + * @since 3.2.0 + */ + protected string $NamespacePrefix; + + /** + * The Component Name (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentName; + + /** + * The Component Namespace (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentNameSpace; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + + // set some global values + $this->NamespacePrefix = $this->config->get('namespace_prefix'); + $this->ComponentName = $this->placeholder->get('Component'); + $this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // get static headers + $headers = $this->getHeaders($context); + + // get dynamic headers + switch ($context) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + case 'admin.views': + $this->setChosenMultiSelectionHeaders($headers, $codeName); + break; + + case 'admin.view.model': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // add to all except the helper classes + if ('admin.helper' !== $context && 'site.helper' !== $context) + { + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;"; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Database\DatabaseInterface;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = ''; + $headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */'; + $headers[] = '$wa = $this->getDocument()->getWebAssetManager();'; + $headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');'; + $headers[] = 'Html::_(\'bootstrap.tooltip\');'; + break; + + case 'admin.view.controller': + $headers[] = 'use Joomla\CMS\Form\FormFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Application\CMSApplication;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\Input\Input;'; + case 'site.admin.view.controller': + $headers[] = 'use Joomla\CMS\Versioning\VersionableControllerTrait;'; + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;"; + break; + + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;"; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Form;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\CMS\Versioning\VersionableModelTrait;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + break; + + case 'dashboard.model': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + case 'admin.views.model': + case 'ajax.admin.model': + case 'ajax.site.model': + case 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ListModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Input\Input;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.component': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'site.view': + case 'site.views': + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'form.custom.field': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Field\###FORM_EXTENDS###;'; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } + + /** + * Build chosen multi selection headers for the view + * + * @param array $headers The headers array + * @param string $nameListCode The list view name + * + * @return void + * @since 3.2.0 + */ + protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode) + { + // check that the filter type is the new filter option (2 = topbar) + if ($this->adminfiltertype->get($nameListCode, 1) == 2) + { + // add category switch + $add_category = false; + if ($this->category->exists("{$nameListCode}.extension") + && $this->category->get("{$nameListCode}.filter", 0) >= 1) + { + // is found so add it + $add_category = true; + } + // add accessLevels switch + $add_access_levels = false; + if ($this->accessswitchlist->exists($nameListCode)) + { + // is found so add it + $add_access_levels = true; + } + // check if this view have filters + if ($this->filter->exists($nameListCode)) + { + foreach ($this->filter->get($nameListCode) as $filter) + { + // we need this only for filters that are multi + if (isset($filter['multi']) && $filter['multi'] == 2) + { + // if this is a category we should make sure it must be added + if (!$add_category && $filter['type'] === 'category') + { + continue; + } + elseif ($add_category && $filter['type'] === 'category') + { + // already added here so no need to add again + $add_category = false; + } + // check if this was an access field + elseif ($filter['type'] === 'accesslevel') + { + // already added here so no need to add again + $add_access_levels = false; + } + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multiple' + . $filter['class'] + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + } + elseif ($add_category && $filter['type'] === 'category') + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + // already added here so no need to add again + $add_category = false; + } + } + } + // add category if not already added + if ($add_category) + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $this->category->exists("{$nameListCode}.name", 'error') + . '\') . \' -\']);'; + } + // add accessLevels if not already added + if ($add_access_levels) + { + // set the language strings for selection + $filter_name_select = 'Select Access'; + $filter_name_select_lang = $this->config->lang_prefix . '_FILTER_' + . StringHelper::safe( + $filter_name_select, 'U' + ); + // and to translation + $this->language->set( + $this->config->lang_target, $filter_name_select_lang, $filter_name_select + ); + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter_name_select_lang . '\') . \' -\']);'; + } + } + } \ No newline at end of file diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json new file mode 100644 index 0000000..0742091 --- /dev/null +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json @@ -0,0 +1,73 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49", + "implements": [ + "3a777d70-52ad-49ec-9016-6f7438608613" + ], + "load_selection": null, + "name": "Header", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaFour.Header", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection2": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection3": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection4": { + "use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d", + "as": "default" + }, + "use_selection5": { + "use": "9481caa2-6d04-4598-8320-543a93927243", + "as": "default" + }, + "use_selection6": { + "use": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection7": { + "use": "81212121-ad5c-43c5-b046-f2650864f690", + "as": "default" + }, + "use_selection8": { + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "as": "default" + }, + "use_selection9": { + "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "as": "default" + }, + "use_selection10": { + "use": "ce8cf834-6bac-44fb-941c-861f7e046cc0", + "as": "default" + }, + "use_selection11": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection12": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFour.Header", + "description": "Build headers for all Joomla 4 files\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md index 21ea5f9..ad373cd 100644 --- a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md @@ -11,13 +11,14 @@ ```uml @startuml class Structure #Gold { + # Placeholder $placeholder # Settings $settings # Paths $paths # Counter $counter # File $file # Files $files # CMSApplication $app - + __construct(?Settings $settings = null, ?Paths $paths = null, ...) + + __construct(Placeholder $placeholder, Settings $settings, ...) + build(array $target, string $type, ...) : bool - getFileDetails(object $details, string $item, ...) : ?array - getPath(object $details, string $zipPath, ...) : ?string @@ -30,11 +31,12 @@ note right of Structure::__construct since: 3.2.0 arguments: - ?Settings $settings = null - ?Paths $paths = null - ?Counter $counter = null - ?File $file = null - ?Files $files = null + Placeholder $placeholder + Settings $settings + Paths $paths + Counter $counter + File $file + Files $files ?CMSApplication $app = null end note diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php index ccef5d6..5cddb26 100644 --- a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php @@ -17,8 +17,8 @@ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File as JoomlaFile; use Joomla\CMS\Filesystem\Folder; -use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; @@ -35,41 +35,49 @@ use VDM\Joomla\Utilities\StringHelper; class Structure { /** - * Compiler Component Joomla Version Settings + * The Placeholder Class. * - * @var Settings + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. + * + * @var Settings * @since 3.2.0 */ protected Settings $settings; /** - * Compiler Utilities Paths + * The Paths Class. * - * @var Paths + * @var Paths * @since 3.2.0 */ protected Paths $paths; /** - * Compiler Counter + * The Counter Class. * - * @var Counter + * @var Counter * @since 3.2.0 */ protected Counter $counter; /** - * Compiler Utilities File + * The File Class. * - * @var File + * @var File * @since 3.2.0 */ protected File $file; /** - * Compiler Utilities Files + * The Files Class. * - * @var Files + * @var Files * @since 3.2.0 */ protected Files $files; @@ -85,25 +93,25 @@ class Structure /** * Constructor. * - * @param Settings|null $settings The compiler component joomla version settings object. - * @param Paths|null $paths The compiler paths object. - * @param Counter|null $counter The compiler counter object. - * @param File|null $file The compiler file object. - * @param Files|null $files The compiler files object. - * @param CMSApplication|null $app The CMS Application object. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Paths $paths The Paths Class. + * @param Counter $counter The Counter Class. + * @param File $file The File Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 - * @throws \Exception */ - public function __construct(?Settings $settings = null, ?Paths $paths = null, - ?Counter $counter = null, ?File $file = null, ?Files $files = null, - ?CMSApplication $app = null) + public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths, + Counter $counter, File $file, Files $files, ?CMSApplication $app = null) { - $this->settings = $settings ?: Compiler::_('Component.Settings'); - $this->paths = $paths ?: Compiler::_('Utilities.Paths'); - $this->counter = $counter ?: Compiler::_('Utilities.Counter'); - $this->file = $file ?: Compiler::_('Utilities.File'); - $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->placeholder = $placeholder; + $this->settings = $settings; + $this->paths = $paths; + $this->counter = $counter; + $this->file = $file; + $this->files = $files; $this->app = $app ?: Factory::getApplication(); } @@ -130,6 +138,15 @@ class Structure // search the target foreach ($target as $main => $name) { + // get the key name (either file name or name) + $key = $fileName ?? $name; + + // add to placeholders as Name and name + $this->placeholder->set('Name', StringHelper::safe($name, 'F')); + $this->placeholder->set('name', StringHelper::safe($name)); + $this->placeholder->set('Key', StringHelper::safe($key, 'F')); + $this->placeholder->set('key', StringHelper::safe($key)); + // make sure it is lower case $name = StringHelper::safe($name); @@ -157,6 +174,12 @@ class Structure } } } + + // remove the name from placeholders + $this->placeholder->remove('Name'); + $this->placeholder->remove('name'); + $this->placeholder->remove('Key'); + $this->placeholder->remove('key'); } } @@ -251,6 +274,8 @@ class Structure { $path = $details->path; } + + $path = $this->placeholder->update_($path); // make sure we have component to replace if (strpos((string) $path, 'c0mp0n3nt') !== false) @@ -291,23 +316,27 @@ class Structure if (!empty($fileName)) { $name = $name . '_' . $fileName; + } - return str_replace( + if ($details->rename === 'new') + { + $item = $details->newName; + } + elseif (!empty($fileName)) + { + $item = str_replace( $details->rename, $fileName, $item ); } - elseif ($details->rename === 'new') + else { - return $details->newName; + $item = str_replace( + $details->rename, $name, $item + ); } - - return str_replace( - $details->rename, $name, $item - ); } - return $item; - } - + return $this->placeholder->update_($item); + } } diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.power b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.power index cb7f27d..53bdb4a 100644 --- a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.power +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.power @@ -1,39 +1,47 @@ /** - * Compiler Component Joomla Version Settings + * The Placeholder Class. * - * @var Settings + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. + * + * @var Settings * @since 3.2.0 */ protected Settings $settings; /** - * Compiler Utilities Paths + * The Paths Class. * - * @var Paths + * @var Paths * @since 3.2.0 */ protected Paths $paths; /** - * Compiler Counter + * The Counter Class. * - * @var Counter + * @var Counter * @since 3.2.0 */ protected Counter $counter; /** - * Compiler Utilities File + * The File Class. * - * @var File + * @var File * @since 3.2.0 */ protected File $file; /** - * Compiler Utilities Files + * The Files Class. * - * @var Files + * @var Files * @since 3.2.0 */ protected Files $files; @@ -49,25 +57,25 @@ /** * Constructor. * - * @param Settings|null $settings The compiler component joomla version settings object. - * @param Paths|null $paths The compiler paths object. - * @param Counter|null $counter The compiler counter object. - * @param File|null $file The compiler file object. - * @param Files|null $files The compiler files object. - * @param CMSApplication|null $app The CMS Application object. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Paths $paths The Paths Class. + * @param Counter $counter The Counter Class. + * @param File $file The File Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 - * @throws \Exception */ - public function __construct(?Settings $settings = null, ?Paths $paths = null, - ?Counter $counter = null, ?File $file = null, ?Files $files = null, - ?CMSApplication $app = null) + public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths, + Counter $counter, File $file, Files $files, ?CMSApplication $app = null) { - $this->settings = $settings ?: Compiler::_('Component.Settings'); - $this->paths = $paths ?: Compiler::_('Utilities.Paths'); - $this->counter = $counter ?: Compiler::_('Utilities.Counter'); - $this->file = $file ?: Compiler::_('Utilities.File'); - $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->placeholder = $placeholder; + $this->settings = $settings; + $this->paths = $paths; + $this->counter = $counter; + $this->file = $file; + $this->files = $files; $this->app = $app ?: Factory::getApplication(); } @@ -94,6 +102,15 @@ // search the target foreach ($target as $main => $name) { + // get the key name (either file name or name) + $key = $fileName ?? $name; + + // add to placeholders as Name and name + $this->placeholder->set('Name', StringHelper::safe($name, 'F')); + $this->placeholder->set('name', StringHelper::safe($name)); + $this->placeholder->set('Key', StringHelper::safe($key, 'F')); + $this->placeholder->set('key', StringHelper::safe($key)); + // make sure it is lower case $name = StringHelper::safe($name); @@ -121,6 +138,12 @@ } } } + + // remove the name from placeholders + $this->placeholder->remove('Name'); + $this->placeholder->remove('name'); + $this->placeholder->remove('Key'); + $this->placeholder->remove('key'); } } @@ -215,6 +238,8 @@ { $path = $details->path; } + + $path = $this->placeholder->update_($path); // make sure we have component to replace if (strpos((string) $path, 'c0mp0n3nt') !== false) @@ -255,20 +280,25 @@ if (!empty($fileName)) { $name = $name . '_' . $fileName; + } - return str_replace( + if ($details->rename === 'new') + { + $item = $details->newName; + } + elseif (!empty($fileName)) + { + $item = str_replace( $details->rename, $fileName, $item ); } - elseif ($details->rename === 'new') + else { - return $details->newName; + $item = str_replace( + $details->rename, $name, $item + ); } - - return str_replace( - $details->rename, $name, $item - ); } - return $item; - } + return $this->placeholder->update_($item); + } \ No newline at end of file diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json index ddedbbe..3f7507e 100644 --- a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json @@ -11,12 +11,12 @@ "type": "class", "use_selection": { "use_selection0": { - "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", - "as": "Compiler" + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" }, "use_selection1": { - "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", - "as": "default" + "use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "as": "Settings" }, "use_selection2": { "use": "6f20369a-8536-4870-a1a3-cda254c939c8", diff --git a/src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md new file mode 100644 index 0000000..14dc07c --- /dev/null +++ b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class FrontendParams (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class FrontendParams << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php new file mode 100644 index 0000000..4e56ac0 --- /dev/null +++ b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Front-end Params Builder Class + * + * @since 3.2.0 + */ +final class FrontendParams extends Registry implements Registryinterface +{ +} + diff --git a/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json new file mode 100644 index 0000000..ce8498d --- /dev/null +++ b/src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "207b5ef3-b3bb-45bf-af14-4572e296d761", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "FrontendParams", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.FrontendParams", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.FrontendParams", + "description": "Front-end Params Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md b/src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md new file mode 100644 index 0000000..7216ed4 --- /dev/null +++ b/src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsCustomfield (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsCustomfield << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # Customfield $customfield + # ConfigFieldsets $configfieldsets + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsCustomfield::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + Customfield $customfield + ConfigFieldsets $configfieldsets +end note + +note right of ConfigFieldsetsCustomfield::set + Set Custom Control Config Fieldsets + + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php b/src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php new file mode 100644 index 0000000..2c6b68b --- /dev/null +++ b/src/208bc37c-0055-44df-9a34-63d6bfa10765/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\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Config Fieldsets Customfield Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsCustomfield +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + Customfield $customfield, + ConfigFieldsets $configfieldsets) + { + $this->config = $config; + $this->language = $language; + $this->customfield = $customfield; + $this->configfieldsets = $configfieldsets; + } + + /** + * Set Custom Control Config Fieldsets + * + * @param string $lang + * + * @since 1.0 + */ + public function set(string $lang): void + { + // add custom new global fields set + if ($this->customfield->isActive()) + { + foreach ($this->customfield->allActive() as $tab => $tabFields) + { + $tabCode = StringHelper::safe($tab) + . '_custom_config'; + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); + // remove display targeted fields + $bucket = []; + foreach ($tabFields as $tabField) + { + $display = GetHelper::between( + $tabField, 'display="', '"' + ); + if (!StringHelper::check($display) + || $display === 'config') + { + // remove this display since it is not used in Joomla + $bucket[] = str_replace( + 'display="config"', '', (string) $tabField + ); + } + } + // only add the tab if it has values + if (ArrayHelper::check($bucket)) + { + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_' . $tabUpper, $tab + ); + // start field set + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="' + . $tabCode . '"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_' . $tabUpper . '">'); + // set the fields + $this->configfieldsets->add('component', implode("", $bucket)); + // close field set + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + // remove after loading + $this->customfield->remove($tab); + } + } + } +} + diff --git a/src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power b/src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power new file mode 100644 index 0000000..807bd31 --- /dev/null +++ b/src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power @@ -0,0 +1,109 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + Customfield $customfield, + ConfigFieldsets $configfieldsets) + { + $this->config = $config; + $this->language = $language; + $this->customfield = $customfield; + $this->configfieldsets = $configfieldsets; + } + + /** + * Set Custom Control Config Fieldsets + * + * @param string $lang + * + * @since 1.0 + */ + public function set(string $lang): void + { + // add custom new global fields set + if ($this->customfield->isActive()) + { + foreach ($this->customfield->allActive() as $tab => $tabFields) + { + $tabCode = StringHelper::safe($tab) + . '_custom_config'; + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); + // remove display targeted fields + $bucket = []; + foreach ($tabFields as $tabField) + { + $display = GetHelper::between( + $tabField, 'display="', '"' + ); + if (!StringHelper::check($display) + || $display === 'config') + { + // remove this display since it is not used in Joomla + $bucket[] = str_replace( + 'display="config"', '', (string) $tabField + ); + } + } + // only add the tab if it has values + if (ArrayHelper::check($bucket)) + { + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_' . $tabUpper, $tab + ); + // start field set + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="' + . $tabCode . '"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_' . $tabUpper . '">'); + // set the fields + $this->configfieldsets->add('component', implode("", $bucket)); + // close field set + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + // remove after loading + $this->customfield->remove($tab); + } + } + } \ No newline at end of file diff --git a/src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json b/src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json new file mode 100644 index 0000000..6b16e38 --- /dev/null +++ b/src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json @@ -0,0 +1,51 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "208bc37c-0055-44df-9a34-63d6bfa10765", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsCustomfield", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsCustomfield", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection3": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection6": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection7": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsCustomfield", + "description": "Config Fieldsets Customfield Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md new file mode 100644 index 0000000..381b281 --- /dev/null +++ b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsets (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsets << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Component $component + # Event $event + # Placeholder $placeholder + # CPlaceholder $cplaceholder + # ExtensionsParams $extensionsparams + # Customfield $customfield + # FieldAsString $fieldasstring + # ConfigFieldsetsGlobal $configfieldsetsglobal + # ConfigFieldsetsSiteControl $configfieldsetssitecontrol + # ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol + # ConfigFieldsetsUikit $configfieldsetsuikit + # ConfigFieldsetsGooglechart $configfieldsetsgooglechart + # ConfigFieldsetsEmailHelper $configfieldsetsemailhelper + # ConfigFieldsetsEncryption $configfieldsetsencryption + # ConfigFieldsetsCustomfield $configfieldsetscustomfield + + __construct(Config $config, Component $component, ...) + + set(int $timer) : void +} + +note right of ConfigFieldsets::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Component $component + Event $event + Placeholder $placeholder + CPlaceholder $cplaceholder + ExtensionsParams $extensionsparams + Customfield $customfield + FieldAsString $fieldasstring + ConfigFieldsetsGlobal $configfieldsetsglobal + ConfigFieldsetsSiteControl $configfieldsetssitecontrol + ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol + ConfigFieldsetsUikit $configfieldsetsuikit + ConfigFieldsetsGooglechart $configfieldsetsgooglechart + ConfigFieldsetsEmailHelper $configfieldsetsemailhelper + ConfigFieldsetsEncryption $configfieldsetsencryption + ConfigFieldsetsCustomfield $configfieldsetscustomfield +end note + +note right of ConfigFieldsets::set + Set Config Fieldsets + + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php new file mode 100644 index 0000000..23aaf39 --- /dev/null +++ b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php @@ -0,0 +1,388 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as CPlaceholder; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldAsString; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsSiteControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsUikit; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Utilities\MathHelper; + + +/** + * Config Fieldsets Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsets +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Placeholder Class. + * + * @var CPlaceholder + * @since 3.2.0 + */ + protected CPlaceholder $cplaceholder; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The FieldAsString Class. + * + * @var FieldAsString + * @since 3.2.0 + */ + protected FieldAsString $fieldasstring; + + /** + * The ConfigFieldsetsGlobal Class. + * + * @var ConfigFieldsetsGlobal + * @since 3.2.0 + */ + protected ConfigFieldsetsGlobal $configfieldsetsglobal; + + /** + * The ConfigFieldsetsSiteControl Class. + * + * @var ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + protected ConfigFieldsetsSiteControl $configfieldsetssitecontrol; + + /** + * The ConfigFieldsetsGroupControl Class. + * + * @var ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + protected ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol; + + /** + * The ConfigFieldsetsUikit Class. + * + * @var ConfigFieldsetsUikit + * @since 3.2.0 + */ + protected ConfigFieldsetsUikit $configfieldsetsuikit; + + /** + * The ConfigFieldsetsGooglechart Class. + * + * @var ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + protected ConfigFieldsetsGooglechart $configfieldsetsgooglechart; + + /** + * The ConfigFieldsetsEmailHelper Class. + * + * @var ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + protected ConfigFieldsetsEmailHelper $configfieldsetsemailhelper; + + /** + * The ConfigFieldsetsEncryption Class. + * + * @var ConfigFieldsetsEncryption + * @since 3.2.0 + */ + protected ConfigFieldsetsEncryption $configfieldsetsencryption; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + protected ConfigFieldsetsCustomfield $configfieldsetscustomfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Component $component The Component Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param CPlaceholder $cplaceholder The Placeholder Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param FieldAsString $fieldasstring The FieldAsString Class. + * @param ConfigFieldsetsGlobal $configfieldsetsglobal The ConfigFieldsetsGlobal Class. + * @param ConfigFieldsetsSiteControl $configfieldsetssitecontrol The ConfigFieldsetsSiteControl Class. + * @param ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol The ConfigFieldsetsGroupControl Class. + * @param ConfigFieldsetsUikit $configfieldsetsuikit The ConfigFieldsetsUikit Class. + * @param ConfigFieldsetsGooglechart $configfieldsetsgooglechart The ConfigFieldsetsGooglechart Class. + * @param ConfigFieldsetsEmailHelper $configfieldsetsemailhelper The ConfigFieldsetsEmailHelper Class. + * @param ConfigFieldsetsEncryption $configfieldsetsencryption The ConfigFieldsetsEncryption Class. + * @param ConfigFieldsetsCustomfield $configfieldsetscustomfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Component $component, Event $event, + Placeholder $placeholder, CPlaceholder $cplaceholder, + ExtensionsParams $extensionsparams, + Customfield $customfield, FieldAsString $fieldasstring, + ConfigFieldsetsGlobal $configfieldsetsglobal, + ConfigFieldsetsSiteControl $configfieldsetssitecontrol, + ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol, + ConfigFieldsetsUikit $configfieldsetsuikit, + ConfigFieldsetsGooglechart $configfieldsetsgooglechart, + ConfigFieldsetsEmailHelper $configfieldsetsemailhelper, + ConfigFieldsetsEncryption $configfieldsetsencryption, + ConfigFieldsetsCustomfield $configfieldsetscustomfield) + { + $this->config = $config; + $this->component = $component; + $this->event = $event; + $this->placeholder = $placeholder; + $this->cplaceholder = $cplaceholder; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + $this->fieldasstring = $fieldasstring; + $this->configfieldsetsglobal = $configfieldsetsglobal; + $this->configfieldsetssitecontrol = $configfieldsetssitecontrol; + $this->configfieldsetsgroupcontrol = $configfieldsetsgroupcontrol; + $this->configfieldsetsuikit = $configfieldsetsuikit; + $this->configfieldsetsgooglechart = $configfieldsetsgooglechart; + $this->configfieldsetsemailhelper = $configfieldsetsemailhelper; + $this->configfieldsetsencryption = $configfieldsetsencryption; + $this->configfieldsetscustomfield = $configfieldsetscustomfield; + } + + /** + * Set Config Fieldsets + * + * @param int $timer + * + * @since 1.0 + */ + public function set(int $timer = 0): void + { + // main lang prefix + $lang = $this->config->lang_prefix . '_CONFIG'; + if (1 == $timer) // this is before the admin views are build + { + // start loading Global params + $autorName = StringHelper::html( + $this->component->get('author') + ); + $autorEmail = StringHelper::html( + $this->component->get('email') + ); + $this->extensionsparams->add('component', '"autorName":"' . $autorName + . '","autorEmail":"' . $autorEmail . '"'); + + // set the custom fields + if ($this->component->isArray('config')) + { + // set component code name + $component = $this->config->component_code_name; + $nameSingleCode = 'config'; + $nameListCode = 'configs'; + + // set place holders + $placeholders = []; + $placeholders[Placefix::_h('component')] + = $this->config->component_code_name; + $placeholders[Placefix::_h('Component')] + = StringHelper::safe( + $this->component->get('name_code'), 'F' + ); + $placeholders[Placefix::_h('COMPONENT')] + = StringHelper::safe( + $this->component->get('name_code'), 'U' + ); + $placeholders[Placefix::_h('view')] + = $nameSingleCode; + $placeholders[Placefix::_h('views')] + = $nameListCode; + $placeholders[Placefix::_('component')] + = $this->config->component_code_name; + $placeholders[Placefix::_('Component')] + = $placeholders[Placefix::_h('Component')]; + $placeholders[Placefix::_('COMPONENT')] + = $placeholders[Placefix::_h('COMPONENT')]; + $placeholders[Placefix::_('view')] + = $nameSingleCode; + $placeholders[Placefix::_('views')] + = $nameListCode; + + // load the global placeholders + foreach ($this->cplaceholder->get() as $globalPlaceholder => $gloabalValue) + { + $placeholders[$globalPlaceholder] = $gloabalValue; + } + $view = []; + $viewType = 0; + // set the custom table key + $dbkey = 'g'; + + // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onBeforeSetConfigFieldsets', [&$timer] + ); + + // build the config fields + foreach ($this->component->get('config') as $field) + { + // get the xml string + $xmlField = $this->fieldasstring->get( + $field, $view, $viewType, $lang, $nameSingleCode, + $nameListCode, $placeholders, $dbkey, false + ); + + // make sure the xml is set and a string + if (isset($xmlField) && StringHelper::check($xmlField)) + { + $this->customfield->add($field['tabname'], $xmlField, true); + // set global params to db on install + $fieldName = StringHelper::safe( + $this->placeholder->update( + GetHelper::between( + $xmlField, 'name="', '"' + ), $placeholders + ) + ); + $fieldDefault = $this->placeholder->update( + GetHelper::between( + $xmlField, 'default="', '"' + ), $placeholders + ); + if (isset($field['custom_value']) + && StringHelper::check( + $field['custom_value'] + )) + { + // add array if found + if ((strpos((string) $field['custom_value'], '["') !== false) + && (strpos((string) $field['custom_value'], '"]') + !== false)) + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName + . '":' . $field['custom_value']); + } + else + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName + . '":"' . $field['custom_value'] . '"'); + } + } + elseif (StringHelper::check($fieldDefault)) + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName . '":"' + . $fieldDefault . '"'); + } + } + } + } + + // first run we must set the global + $this->configfieldsetsglobal->set($lang, $autorName, $autorEmail); + $this->configfieldsetssitecontrol->set($lang); + } + elseif (2 == $timer) // this is after the admin views are build + { + // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onBeforeSetConfigFieldsets', [&$timer] + ); + + // these field sets can only be added after admin view is build + $this->configfieldsetsgroupcontrol->set($lang); + + // these can be added anytime really (but looks best after groups + $this->configfieldsetsuikit->set($lang); + $this->configfieldsetsgooglechart->set($lang); + $this->configfieldsetsemailhelper->set($lang); + $this->configfieldsetsencryption->set($lang); + + // these are the custom settings + $this->configfieldsetscustomfield->set($lang); + } + + // Trigger Event: jcb_ce_onAfterSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onAfterSetConfigFieldsets', [&$timer] + ); + } +} + diff --git a/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power new file mode 100644 index 0000000..0ac9ea2 --- /dev/null +++ b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power @@ -0,0 +1,340 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Placeholder Class. + * + * @var CPlaceholder + * @since 3.2.0 + */ + protected CPlaceholder $cplaceholder; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The FieldAsString Class. + * + * @var FieldAsString + * @since 3.2.0 + */ + protected FieldAsString $fieldasstring; + + /** + * The ConfigFieldsetsGlobal Class. + * + * @var ConfigFieldsetsGlobal + * @since 3.2.0 + */ + protected ConfigFieldsetsGlobal $configfieldsetsglobal; + + /** + * The ConfigFieldsetsSiteControl Class. + * + * @var ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + protected ConfigFieldsetsSiteControl $configfieldsetssitecontrol; + + /** + * The ConfigFieldsetsGroupControl Class. + * + * @var ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + protected ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol; + + /** + * The ConfigFieldsetsUikit Class. + * + * @var ConfigFieldsetsUikit + * @since 3.2.0 + */ + protected ConfigFieldsetsUikit $configfieldsetsuikit; + + /** + * The ConfigFieldsetsGooglechart Class. + * + * @var ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + protected ConfigFieldsetsGooglechart $configfieldsetsgooglechart; + + /** + * The ConfigFieldsetsEmailHelper Class. + * + * @var ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + protected ConfigFieldsetsEmailHelper $configfieldsetsemailhelper; + + /** + * The ConfigFieldsetsEncryption Class. + * + * @var ConfigFieldsetsEncryption + * @since 3.2.0 + */ + protected ConfigFieldsetsEncryption $configfieldsetsencryption; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + protected ConfigFieldsetsCustomfield $configfieldsetscustomfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Component $component The Component Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param CPlaceholder $cplaceholder The Placeholder Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param FieldAsString $fieldasstring The FieldAsString Class. + * @param ConfigFieldsetsGlobal $configfieldsetsglobal The ConfigFieldsetsGlobal Class. + * @param ConfigFieldsetsSiteControl $configfieldsetssitecontrol The ConfigFieldsetsSiteControl Class. + * @param ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol The ConfigFieldsetsGroupControl Class. + * @param ConfigFieldsetsUikit $configfieldsetsuikit The ConfigFieldsetsUikit Class. + * @param ConfigFieldsetsGooglechart $configfieldsetsgooglechart The ConfigFieldsetsGooglechart Class. + * @param ConfigFieldsetsEmailHelper $configfieldsetsemailhelper The ConfigFieldsetsEmailHelper Class. + * @param ConfigFieldsetsEncryption $configfieldsetsencryption The ConfigFieldsetsEncryption Class. + * @param ConfigFieldsetsCustomfield $configfieldsetscustomfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Component $component, Event $event, + Placeholder $placeholder, CPlaceholder $cplaceholder, + ExtensionsParams $extensionsparams, + Customfield $customfield, FieldAsString $fieldasstring, + ConfigFieldsetsGlobal $configfieldsetsglobal, + ConfigFieldsetsSiteControl $configfieldsetssitecontrol, + ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol, + ConfigFieldsetsUikit $configfieldsetsuikit, + ConfigFieldsetsGooglechart $configfieldsetsgooglechart, + ConfigFieldsetsEmailHelper $configfieldsetsemailhelper, + ConfigFieldsetsEncryption $configfieldsetsencryption, + ConfigFieldsetsCustomfield $configfieldsetscustomfield) + { + $this->config = $config; + $this->component = $component; + $this->event = $event; + $this->placeholder = $placeholder; + $this->cplaceholder = $cplaceholder; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + $this->fieldasstring = $fieldasstring; + $this->configfieldsetsglobal = $configfieldsetsglobal; + $this->configfieldsetssitecontrol = $configfieldsetssitecontrol; + $this->configfieldsetsgroupcontrol = $configfieldsetsgroupcontrol; + $this->configfieldsetsuikit = $configfieldsetsuikit; + $this->configfieldsetsgooglechart = $configfieldsetsgooglechart; + $this->configfieldsetsemailhelper = $configfieldsetsemailhelper; + $this->configfieldsetsencryption = $configfieldsetsencryption; + $this->configfieldsetscustomfield = $configfieldsetscustomfield; + } + + /** + * Set Config Fieldsets + * + * @param int $timer + * + * @since 1.0 + */ + public function set(int $timer = 0): void + { + // main lang prefix + $lang = $this->config->lang_prefix . '_CONFIG'; + if (1 == $timer) // this is before the admin views are build + { + // start loading Global params + $autorName = StringHelper::html( + $this->component->get('author') + ); + $autorEmail = StringHelper::html( + $this->component->get('email') + ); + $this->extensionsparams->add('component', '"autorName":"' . $autorName + . '","autorEmail":"' . $autorEmail . '"'); + + // set the custom fields + if ($this->component->isArray('config')) + { + // set component code name + $component = $this->config->component_code_name; + $nameSingleCode = 'config'; + $nameListCode = 'configs'; + + // set place holders + $placeholders = []; + $placeholders[Placefix::_h('component')] + = $this->config->component_code_name; + $placeholders[Placefix::_h('Component')] + = StringHelper::safe( + $this->component->get('name_code'), 'F' + ); + $placeholders[Placefix::_h('COMPONENT')] + = StringHelper::safe( + $this->component->get('name_code'), 'U' + ); + $placeholders[Placefix::_h('view')] + = $nameSingleCode; + $placeholders[Placefix::_h('views')] + = $nameListCode; + $placeholders[Placefix::_('component')] + = $this->config->component_code_name; + $placeholders[Placefix::_('Component')] + = $placeholders[Placefix::_h('Component')]; + $placeholders[Placefix::_('COMPONENT')] + = $placeholders[Placefix::_h('COMPONENT')]; + $placeholders[Placefix::_('view')] + = $nameSingleCode; + $placeholders[Placefix::_('views')] + = $nameListCode; + + // load the global placeholders + foreach ($this->cplaceholder->get() as $globalPlaceholder => $gloabalValue) + { + $placeholders[$globalPlaceholder] = $gloabalValue; + } + $view = []; + $viewType = 0; + // set the custom table key + $dbkey = 'g'; + + // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onBeforeSetConfigFieldsets', [&$timer] + ); + + // build the config fields + foreach ($this->component->get('config') as $field) + { + // get the xml string + $xmlField = $this->fieldasstring->get( + $field, $view, $viewType, $lang, $nameSingleCode, + $nameListCode, $placeholders, $dbkey, false + ); + + // make sure the xml is set and a string + if (isset($xmlField) && StringHelper::check($xmlField)) + { + $this->customfield->add($field['tabname'], $xmlField, true); + // set global params to db on install + $fieldName = StringHelper::safe( + $this->placeholder->update( + GetHelper::between( + $xmlField, 'name="', '"' + ), $placeholders + ) + ); + $fieldDefault = $this->placeholder->update( + GetHelper::between( + $xmlField, 'default="', '"' + ), $placeholders + ); + if (isset($field['custom_value']) + && StringHelper::check( + $field['custom_value'] + )) + { + // add array if found + if ((strpos((string) $field['custom_value'], '["') !== false) + && (strpos((string) $field['custom_value'], '"]') + !== false)) + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName + . '":' . $field['custom_value']); + } + else + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName + . '":"' . $field['custom_value'] . '"'); + } + } + elseif (StringHelper::check($fieldDefault)) + { + // load the Global checkin defautls + $this->extensionsparams->add('component', '"' . $fieldName . '":"' + . $fieldDefault . '"'); + } + } + } + } + + // first run we must set the global + $this->configfieldsetsglobal->set($lang, $autorName, $autorEmail); + $this->configfieldsetssitecontrol->set($lang); + } + elseif (2 == $timer) // this is after the admin views are build + { + // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onBeforeSetConfigFieldsets', [&$timer] + ); + + // these field sets can only be added after admin view is build + $this->configfieldsetsgroupcontrol->set($lang); + + // these can be added anytime really (but looks best after groups + $this->configfieldsetsuikit->set($lang); + $this->configfieldsetsgooglechart->set($lang); + $this->configfieldsetsemailhelper->set($lang); + $this->configfieldsetsencryption->set($lang); + + // these are the custom settings + $this->configfieldsetscustomfield->set($lang); + } + + // Trigger Event: jcb_ce_onAfterSetConfigFieldsets + $this->event->trigger( + 'jcb_ce_onAfterSetConfigFieldsets', [&$timer] + ); + } \ No newline at end of file diff --git a/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json new file mode 100644 index 0000000..1587732 --- /dev/null +++ b/src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json @@ -0,0 +1,111 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "20cf1825-29d0-4c6c-8fe9-a1e13a4dac53", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsets", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsets", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection2": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection3": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection4": { + "use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "as": "CPlaceholder" + }, + "use_selection5": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection6": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection7": { + "use": "f48764e0-16c6-459c-8576-af7616f3b720", + "as": "default" + }, + "use_selection8": { + "use": "0fe3133d-1ff3-4444-9229-4218d8fb338e", + "as": "default" + }, + "use_selection9": { + "use": "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11", + "as": "default" + }, + "use_selection10": { + "use": "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74", + "as": "default" + }, + "use_selection11": { + "use": "84c11075-570a-4907-9be0-9305e0fabe3c", + "as": "default" + }, + "use_selection12": { + "use": "31c8127c-0d42-4e09-be81-7cf243c5b30f", + "as": "default" + }, + "use_selection13": { + "use": "d80e58b8-8462-47c4-9dcd-380445f1c64a", + "as": "default" + }, + "use_selection14": { + "use": "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab", + "as": "default" + }, + "use_selection15": { + "use": "208bc37c-0055-44df-9a34-63d6bfa10765", + "as": "default" + }, + "use_selection16": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection17": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection18": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection19": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection20": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection21": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection22": { + "use": "152c8793-8b75-4715-996a-257b9f65451c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsets", + "description": "Config Fieldsets Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md index 61eb213..9c096ca 100644 --- a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md @@ -11,7 +11,7 @@ ```uml @startuml interface EventInterface #Lavender { - + trigger(string $event, mixed $data) : void + + trigger(string $event, mixed $data = null) : void } note right of EventInterface::trigger diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php index 0f9b960..12a9cee 100644 --- a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php @@ -28,6 +28,6 @@ interface EventInterface * @return void * @since 3.2.0 */ - public function trigger(string $event, $data); + public function trigger(string $event, $data = null); } diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.power b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.power index cc0b570..4799fef 100644 --- a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.power +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.power @@ -7,4 +7,4 @@ * @return void * @since 3.2.0 */ - public function trigger(string $event, $data); \ No newline at end of file + public function trigger(string $event, $data = null); \ No newline at end of file diff --git a/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md new file mode 100644 index 0000000..d6b3d96 --- /dev/null +++ b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CanDelete (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model** +```uml +@startuml +class CanDelete << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + + __construct(Config $config, Permission $permission) + + get(string $nameSingleCode) : string +} + +note right of CanDelete::__construct + Constructor. + + since: 3.2.0 +end note + +note right of CanDelete::get + Get Model Can Delete Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php new file mode 100644 index 0000000..ff67ae8 --- /dev/null +++ b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/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\Architecture\JoomlaThree\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface; + + +/** + * Model Can Delete Class for Joomla 3 + * + * @since 3.2.0 + */ +final class CanDelete implements CanDeleteInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Model Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "if (!empty(\$record->id))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "if (\$record->published != -2)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return;"; + $allow[] = Indent::_(3) . "}"; + // check if the item has permissions. + $allow[] = PHP_EOL . Indent::_(3) + . "\$user = Factory::getUser();"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + $allow[] = Indent::_(3) . "return \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$record->id);"; + $allow[] = Indent::_(2) . "}"; + $allow[] = Indent::_(2) . "return false;"; + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power new file mode 100644 index 0000000..a70f03c --- /dev/null +++ b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power @@ -0,0 +1,61 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Model Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "if (!empty(\$record->id))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "if (\$record->published != -2)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return;"; + $allow[] = Indent::_(3) . "}"; + // check if the item has permissions. + $allow[] = PHP_EOL . Indent::_(3) + . "\$user = Factory::getUser();"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + $allow[] = Indent::_(3) . "return \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$record->id);"; + $allow[] = Indent::_(2) . "}"; + $allow[] = Indent::_(2) . "return false;"; + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json new file mode 100644 index 0000000..a44d771 --- /dev/null +++ b/src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "23766738-d0a4-4d0a-8555-7e4c97c0cddd", + "implements": [ + "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91" + ], + "load_selection": null, + "name": "CanDelete", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J3.Model.CanDelete", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaThree.Model.CanDelete", + "description": "Model Can Delete Class for Joomla 3\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md new file mode 100644 index 0000000..dd14dcb --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md @@ -0,0 +1,109 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class FileInjector (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class FileInjector << (F,LightGreen) >> #RoyalBlue { + # Power $power + + __construct(Power $power) + + add(string $file, string $data, ...) : void + - openFileWithLock(string $file) : resource + - processFile(resource $actual_file, resource $temp_file, ...) : void + - truncateIfNeeded(resource $actual_file, string $data, ...) : void + - copyRemainingData(resource $actual_file, resource $temp_file, ...) : void + - injectSuperPowers(resource $actual_file) : void +} + +note right of FileInjector::__construct + Constructor. + + since: 3.2.0 +end note + +note right of FileInjector::add + Inserts or replaces data in a file at a specific position. + + since: 3.2.0 + return: void + + arguments: + string $file + string $data + int $position + ?int $replace = null +end note + +note right of FileInjector::openFileWithLock + Opens a file and acquires an exclusive lock on it. + + since: 3.2.0 + return: resource +end note + +note right of FileInjector::processFile + Processes the file for data insertion and copying the remaining data. + + since: 3.2.0 + return: void + + arguments: + resource $actual_file + resource $temp_file + string $data + int $position + ?int $replace +end note + +note right of FileInjector::truncateIfNeeded + Truncates the file after data insertion if necessary. + + since: 3.2.0 + return: void + + arguments: + resource $actual_file + string $data + int $position +end note + +note right of FileInjector::copyRemainingData + Copies the remaining data from the temporary stream to the actual file. + + since: 3.2.0 + return: void + + arguments: + resource $actual_file + resource $temp_file + int $position + ?int $replace +end note + +note right of FileInjector::injectSuperPowers + Injects super powers into the file content, if found, and updates the file. + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + 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..47c9af0 --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/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\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power; +use VDM\Joomla\Utilities\MathHelper; + + +/** + * File Injector + * Thanks to http://stackoverflow.com/a/16813550/1429677 + * + * @since 3.2.0 + */ +final class FileInjector +{ + /** + * The Injector Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + + /** + * The pattern to get the powers + * + * @var string + * @since 3.2.0 + **/ + protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * Constructor. + * + * @param Power $power The Injector Class. + * + * @since 3.2.0 + */ + public function __construct(Power $power) + { + $this->power = $power; + } + + /** + * Inserts or replaces data in a file at a specific position. + * + * @param string $file The path of the file to modify. + * @param string $data The data to insert or replace. + * @param int $position The position in the file where the data should be inserted or replaced. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @throws \RuntimeException If unable to open or modify the file. + * @throws \InvalidArgumentException If the position is negative. + * @since 3.2.0 + */ + public function add(string $file, string $data, int $position, ?int $replace = null): void + { + if ($position < 0) + { + throw new \InvalidArgumentException('Position cannot be negative.'); + } + + $found_super_powers = preg_match($this->pattern, $data); + $actual_file = $this->openFileWithLock($file); + + try + { + $temp_file = fopen('php://temp', "rw+"); + if ($temp_file === false) + { + throw new \RuntimeException("Unable to open temporary file."); + } + + $this->processFile($actual_file, $temp_file, $data, $position, $replace); + + if ($found_super_powers) + { + $this->injectSuperPowers($actual_file); + } + } + finally + { + flock($actual_file, LOCK_UN); + fclose($actual_file); + if (isset($temp_file)) + { + fclose($temp_file); + } + } + } + + /** + * Opens a file and acquires an exclusive lock on it. + * + * @param string $file The file path to open. + * + * @return resource The file handle. + * @throws \RuntimeException If the file cannot be opened or locked. + * @since 3.2.0 + */ + private function openFileWithLock(string $file) + { + $actual_file = fopen($file, "rw+"); + if ($actual_file === false || !flock($actual_file, LOCK_EX)) + { + throw new \RuntimeException("Unable to open and lock the file: {$file}"); + } + return $actual_file; + } + + /** + * Processes the file for data insertion and copying the remaining data. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param string $data The data to be inserted. + * @param int $position The position in the file for the data insertion. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @since 3.2.0 + */ + private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void + { + // Make a copy of the file in the temporary stream + stream_copy_to_stream($actual_file, $temp_file); + + // Move to the position where the data should be added + fseek($actual_file, $position); + + // Add the data + fwrite($actual_file, $data); + + $this->truncateIfNeeded($actual_file, $data, $position); + $this->copyRemainingData($actual_file, $temp_file, $position, $replace); + } + + /** + * Truncates the file after data insertion if necessary. + * + * @param resource $actual_file The file handle. + * @param string $data The data that was inserted. + * @param int $position The position where data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function truncateIfNeeded($actual_file, string $data, int $position): void + { + // Truncate the file at the end of the added data if replacing + $data_length = mb_strlen($data, '8bit'); + $remove = MathHelper::bc('add', $position, $data_length); + ftruncate($actual_file, $remove); + } + + /** + * Copies the remaining data from the temporary stream to the actual file. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param int $position The position in the file where data insertion finished. + * @param int|null $replace The number of bytes that were replaced; if null, data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void + { + // check if this was a replacement of data + $position = MathHelper::bc('add', $position, $replace ?: 0); + + // Move to the position of the remaining data in the temporary stream + fseek($temp_file, $position); + + // Copy the remaining data from the temporary stream to the file + stream_copy_to_stream($temp_file, $actual_file); + } + + /** + * Injects super powers into the file content, if found, and updates the file. + * + * @param resource $actual_file The file handle of the actual file. + * + * @return void + * @since 3.2.0 + */ + private function injectSuperPowers($actual_file): void + { + rewind($actual_file); + + $power_data = $this->power->power( + stream_get_contents($actual_file) + ); + + ftruncate($actual_file, 0); + rewind($actual_file); + + fwrite($actual_file, $power_data); + } +} + diff --git a/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.power b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.power new file mode 100644 index 0000000..851a68a --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.power @@ -0,0 +1,185 @@ + /** + * The Injector Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + + /** + * The pattern to get the powers + * + * @var string + * @since 3.2.0 + **/ + protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * Constructor. + * + * @param Power $power The Injector Class. + * + * @since 3.2.0 + */ + public function __construct(Power $power) + { + $this->power = $power; + } + + /** + * Inserts or replaces data in a file at a specific position. + * + * @param string $file The path of the file to modify. + * @param string $data The data to insert or replace. + * @param int $position The position in the file where the data should be inserted or replaced. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @throws \RuntimeException If unable to open or modify the file. + * @throws \InvalidArgumentException If the position is negative. + * @since 3.2.0 + */ + public function add(string $file, string $data, int $position, ?int $replace = null): void + { + if ($position < 0) + { + throw new \InvalidArgumentException('Position cannot be negative.'); + } + + $found_super_powers = preg_match($this->pattern, $data); + $actual_file = $this->openFileWithLock($file); + + try + { + $temp_file = fopen('php://temp', "rw+"); + if ($temp_file === false) + { + throw new \RuntimeException("Unable to open temporary file."); + } + + $this->processFile($actual_file, $temp_file, $data, $position, $replace); + + if ($found_super_powers) + { + $this->injectSuperPowers($actual_file); + } + } + finally + { + flock($actual_file, LOCK_UN); + fclose($actual_file); + if (isset($temp_file)) + { + fclose($temp_file); + } + } + } + + /** + * Opens a file and acquires an exclusive lock on it. + * + * @param string $file The file path to open. + * + * @return resource The file handle. + * @throws \RuntimeException If the file cannot be opened or locked. + * @since 3.2.0 + */ + private function openFileWithLock(string $file) + { + $actual_file = fopen($file, "rw+"); + if ($actual_file === false || !flock($actual_file, LOCK_EX)) + { + throw new \RuntimeException("Unable to open and lock the file: {$file}"); + } + return $actual_file; + } + + /** + * Processes the file for data insertion and copying the remaining data. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param string $data The data to be inserted. + * @param int $position The position in the file for the data insertion. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @since 3.2.0 + */ + private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void + { + // Make a copy of the file in the temporary stream + stream_copy_to_stream($actual_file, $temp_file); + + // Move to the position where the data should be added + fseek($actual_file, $position); + + // Add the data + fwrite($actual_file, $data); + + $this->truncateIfNeeded($actual_file, $data, $position); + $this->copyRemainingData($actual_file, $temp_file, $position, $replace); + } + + /** + * Truncates the file after data insertion if necessary. + * + * @param resource $actual_file The file handle. + * @param string $data The data that was inserted. + * @param int $position The position where data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function truncateIfNeeded($actual_file, string $data, int $position): void + { + // Truncate the file at the end of the added data if replacing + $data_length = mb_strlen($data, '8bit'); + $remove = MathHelper::bc('add', $position, $data_length); + ftruncate($actual_file, $remove); + } + + /** + * Copies the remaining data from the temporary stream to the actual file. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param int $position The position in the file where data insertion finished. + * @param int|null $replace The number of bytes that were replaced; if null, data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void + { + // check if this was a replacement of data + $position = MathHelper::bc('add', $position, $replace ?: 0); + + // Move to the position of the remaining data in the temporary stream + fseek($temp_file, $position); + + // Copy the remaining data from the temporary stream to the file + stream_copy_to_stream($temp_file, $actual_file); + } + + /** + * Injects super powers into the file content, if found, and updates the file. + * + * @param resource $actual_file The file handle of the actual file. + * + * @return void + * @since 3.2.0 + */ + private function injectSuperPowers($actual_file): void + { + rewind($actual_file); + + $power_data = $this->power->power( + stream_get_contents($actual_file) + ); + + ftruncate($actual_file, 0); + rewind($actual_file); + + fwrite($actual_file, $power_data); + } \ No newline at end of file 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..755b25e --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "23f2ca33-440a-4941-8e9a-4bc67522c0cb", + "implements": null, + "load_selection": null, + "name": "FileInjector", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.FileInjector", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "763d137c-42bc-4282-98d8-cc5c0654985f", + "as": "Power" + }, + "use_selection1": { + "use": "152c8793-8b75-4715-996a-257b9f65451c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.FileInjector", + "description": "File Injector\r\n Thanks to http:\/\/stackoverflow.com\/a\/16813550\/1429677\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md index 60812e1..57fab13 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md @@ -6,29 +6,37 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class CoreValidation (Details) +# class CoreRule (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree** ```uml @startuml -class CoreValidation #Gold { - # ?array $rules +class CoreRule #Gold { + # array $rules # string $path + __construct() + get(bool $lowercase = false) : array + - set(string $path) : void } -note right of CoreValidation::__construct +note right of CoreRule::__construct Constructor since: 3.2.0 end note -note right of CoreValidation::get +note right of CoreRule::get Get the Array of Existing Validation Rule Names since: 3.2.0 return: array end note + +note right of CoreRule::set + Set the rules found in a path + + since: 3.2.0 + return: void +end note @enduml ``` diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php index 7583cd6..e8e8100 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php @@ -14,23 +14,23 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree; use Joomla\CMS\Filesystem\Folder; use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface; /** - * Core Joomla Field Validation Rules + * Core Joomla Field Rules * * @since 3.2.0 */ -class CoreValidation implements CoreValidationInterface +class CoreRule implements CoreRuleInterface { /** * Local Core Joomla Rules * - * @var array|null + * @var array * @since 3.2.0 **/ - protected ?array $rules = null; + protected array $rules = []; /** * Local Core Joomla Rules Path @@ -61,41 +61,13 @@ class CoreValidation implements CoreValidationInterface */ public function get(bool $lowercase = false): array { - if (!$this->rules) + if ($this->rules === []) { - // check if the path exist - if (!Folder::exists($this->path)) - { - return []; - } - - // we must first store the current working directory - $joomla = getcwd(); - - // go to that folder - chdir($this->path); - - // load all the files in this path - $rules = Folder::files('.', '\.php', true, true); - - // change back to Joomla working directory - chdir($joomla); - - // make sure we have an array - if (!ArrayHelper::check($rules)) - { - return false; - } - - // remove the Rule.php from the name - $this->rules = array_map( - fn($name): string => str_replace(array('./','Rule.php'), '', (string) $name), - $rules - ); + $this->set($this->path); } // return rules if found - if (is_array($this->rules)) + if ($this->rules !== []) { // check if the names should be all lowercase if ($lowercase) @@ -105,12 +77,49 @@ class CoreValidation implements CoreValidationInterface $this->rules ); } + return $this->rules; } // return empty array return []; } - + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } } diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.power b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.power index 04ba201..6d176ce 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.power +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.power @@ -1,10 +1,10 @@ /** * Local Core Joomla Rules * - * @var array|null + * @var array * @since 3.2.0 **/ - protected ?array $rules = null; + protected array $rules = []; /** * Local Core Joomla Rules Path @@ -35,41 +35,13 @@ */ public function get(bool $lowercase = false): array { - if (!$this->rules) + if ($this->rules === []) { - // check if the path exist - if (!Folder::exists($this->path)) - { - return []; - } - - // we must first store the current working directory - $joomla = getcwd(); - - // go to that folder - chdir($this->path); - - // load all the files in this path - $rules = Folder::files('.', '\.php', true, true); - - // change back to Joomla working directory - chdir($joomla); - - // make sure we have an array - if (!ArrayHelper::check($rules)) - { - return false; - } - - // remove the Rule.php from the name - $this->rules = array_map( - fn($name): string => str_replace(array('./','Rule.php'), '', (string) $name), - $rules - ); + $this->set($this->path); } // return rules if found - if (is_array($this->rules)) + if ($this->rules !== []) { // check if the names should be all lowercase if ($lowercase) @@ -79,9 +51,47 @@ $this->rules ); } + return $this->rules; } // return empty array return []; } + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } \ No newline at end of file diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json index 09d9cc5..0a5a5ef 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json @@ -7,9 +7,9 @@ "b9f05dc4-d23a-499a-a826-9749b81818ed" ], "load_selection": null, - "name": "CoreValidation", + "name": "CoreRule", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Field.JoomlaThree.CoreValidation", + "system_name": "JCB.Compiler.Field.J3.CoreRule", "type": "class", "use_selection": { "use_selection0": { @@ -17,8 +17,8 @@ "as": "default" } }, - "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.CoreValidation", - "description": "Core Joomla Field Validation Rules\r\n\r\n@since 3.2.0", + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.CoreRule", + "description": "Core Joomla Field Rules\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\CMS\\Filesystem\\Folder;", "composer": "" diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md new file mode 100644 index 0000000..6622d52 --- /dev/null +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class History (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour** +```uml +@startuml +class History #Gold { + # ?object $tmp + # Config $config + # $db + + __construct(?Config $config = null) + + get(string $type, int $id) : ?object + # set(object $object, int $action) : bool +} + +note right of History::__construct + Constructor + + since: 3.2.0 +end note + +note right of History::get + Get Item History object + + since: 3.2.0 + return: ?object +end note + +note right of History::set + Set Item History Watch +0 = remove watch +1 = add watch + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php new file mode 100644 index 0000000..7256866 --- /dev/null +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php @@ -0,0 +1,230 @@ + + * @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\JoomlaFour; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; + + +/** + * Compiler History + * + * @since 3.2.0 + */ +class History implements HistoryInterface +{ + /** + * History Item Object + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $tmp; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Database object to query local DB + * + * @since 3.2.0 + */ + protected $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = Factory::getDbo(); + } + + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object + { + // quick class object to store old history object + $this->tmp = null; + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query, 0, 1); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // new version of this item found + // so we need to mark it as the last compiled version + $newActive = $this->db->loadObject(); + // set the new version watch + $this->set($newActive, 1); + } + // Get last compiled verion + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + $query->where('h.keep_forever = 1'); + $query->where('h.version_note LIKE ' . $this->db->quote('%component%')); + // make sure it does not return the active version + if (isset($newActive) && isset($newActive->version_id)) + { + $query->where('h.version_id != ' . (int) $newActive->version_id); + } + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // the old active version was found + // so we may need to do an SQL update + // and unmark the old compiled version + $oldActives = $this->db->loadObjectList(); + foreach ($oldActives as $oldActive) + { + // remove old version watch + $this->set($oldActive, 0); + } + } + + // return the last used history record or null. + return $this->tmp; + } + + /** + * Set Item History Watch + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * + * @return bool + * @since 3.2.0 + */ + protected function set(object $object, int $action): bool + { + // check the note + if (JsonHelper::check($object->version_note)) + { + $version_note = json_decode((string) $object->version_note, true); + } + else + { + $version_note = array('component' => []); + } + // set watch + switch ($action) + { + case 0: + // remove watch + if (isset($version_note['component']) + && ($key = array_search( + $this->config->component_id, $version_note['component'] + )) !== false) + { + // last version that was used to build/compile + $this->tmp = json_decode((string) $object->version_data); + // remove it from this component + unset($version_note['component'][$key]); + } + else + { + // since it was not found, no need to update anything + return true; + } + break; + case 1: + // add watch + if (!in_array($this->config->component_id, $version_note['component'])) + { + $version_note['component'][] = $this->config->component_id; + } + else + { + // since it is there already, no need to update anything + return true; + } + break; + } + // check if we need to still keep this locked + if (isset($version_note['component']) + && ArrayHelper::check($version_note['component'])) + { + // insure component ids are only added once per item + $version_note['component'] = array_unique( + $version_note['component'] + ); + // we may change this, little risky (but since JCB does not have history notes it should be okay for now) + $object->version_note = json_encode($version_note); + $object->keep_forever = '1'; + } + else + { + $object->version_note = ''; + $object->keep_forever = '0'; + } + + // run the update + return $this->db->updateObject('#__ucm_history', $object, 'version_id'); + } + +} + diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power new file mode 100644 index 0000000..1c89814 --- /dev/null +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power @@ -0,0 +1,198 @@ + /** + * History Item Object + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $tmp; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Database object to query local DB + * + * @since 3.2.0 + */ + protected $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = Factory::getDbo(); + } + + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object + { + // quick class object to store old history object + $this->tmp = null; + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query, 0, 1); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // new version of this item found + // so we need to mark it as the last compiled version + $newActive = $this->db->loadObject(); + // set the new version watch + $this->set($newActive, 1); + } + // Get last compiled verion + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + $query->where('h.keep_forever = 1'); + $query->where('h.version_note LIKE ' . $this->db->quote('%component%')); + // make sure it does not return the active version + if (isset($newActive) && isset($newActive->version_id)) + { + $query->where('h.version_id != ' . (int) $newActive->version_id); + } + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // the old active version was found + // so we may need to do an SQL update + // and unmark the old compiled version + $oldActives = $this->db->loadObjectList(); + foreach ($oldActives as $oldActive) + { + // remove old version watch + $this->set($oldActive, 0); + } + } + + // return the last used history record or null. + return $this->tmp; + } + + /** + * Set Item History Watch + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * + * @return bool + * @since 3.2.0 + */ + protected function set(object $object, int $action): bool + { + // check the note + if (JsonHelper::check($object->version_note)) + { + $version_note = json_decode((string) $object->version_note, true); + } + else + { + $version_note = array('component' => []); + } + // set watch + switch ($action) + { + case 0: + // remove watch + if (isset($version_note['component']) + && ($key = array_search( + $this->config->component_id, $version_note['component'] + )) !== false) + { + // last version that was used to build/compile + $this->tmp = json_decode((string) $object->version_data); + // remove it from this component + unset($version_note['component'][$key]); + } + else + { + // since it was not found, no need to update anything + return true; + } + break; + case 1: + // add watch + if (!in_array($this->config->component_id, $version_note['component'])) + { + $version_note['component'][] = $this->config->component_id; + } + else + { + // since it is there already, no need to update anything + return true; + } + break; + } + // check if we need to still keep this locked + if (isset($version_note['component']) + && ArrayHelper::check($version_note['component'])) + { + // insure component ids are only added once per item + $version_note['component'] = array_unique( + $version_note['component'] + ); + // we may change this, little risky (but since JCB does not have history notes it should be okay for now) + $object->version_note = json_encode($version_note); + $object->keep_forever = '1'; + } + else + { + $object->version_note = ''; + $object->keep_forever = '0'; + } + + // run the update + return $this->db->updateObject('#__ucm_history', $object, 'version_id'); + } diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json new file mode 100644 index 0000000..0b90294 --- /dev/null +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "25c7ca86-6088-4f5f-b9fe-13504779c6ba", + "implements": [ + "4325745f-da1f-4d4d-a591-3189fe8c06e5" + ], + "load_selection": null, + "name": "History", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaFour.History", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFour.History", + "description": "Compiler History\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Factory;", + "composer": "" +} \ No newline at end of file diff --git a/src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md b/src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md new file mode 100644 index 0000000..07ac5ad --- /dev/null +++ b/src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Contributors (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class Contributors << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php b/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php new file mode 100644 index 0000000..80bdc07 --- /dev/null +++ b/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Contributors Builder Class + * + * @since 3.2.0 + */ +final class Contributors extends Registry implements Registryinterface +{ +} + diff --git a/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power b/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json b/src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json new file mode 100644 index 0000000..a965a29 --- /dev/null +++ b/src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "274a78d1-24c2-4486-b560-b86e9ae72872", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "Contributors", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.Contributors", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.Contributors", + "description": "Contributors Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md new file mode 100644 index 0000000..fb78f07 --- /dev/null +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CanDelete (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model** +```uml +@startuml +class CanDelete << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + + __construct(Config $config, Permission $permission) + + get(string $nameSingleCode) : string +} + +note right of CanDelete::__construct + Constructor. + + since: 3.2.0 +end note + +note right of CanDelete::get + Get Can Delete Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php new file mode 100644 index 0000000..48f20a5 --- /dev/null +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php @@ -0,0 +1,87 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface; + + +/** + * Model Can Delete Class for Joomla 4 + * + * @since 3.2.0 + */ +final class CanDelete implements CanDeleteInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->state != -2))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}" . PHP_EOL; + + // check if the item has permissions. + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + $allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$record->id);"; + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power new file mode 100644 index 0000000..789fc48 --- /dev/null +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power @@ -0,0 +1,57 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->state != -2))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}" . PHP_EOL; + + // check if the item has permissions. + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + $allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$record->id);"; + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json new file mode 100644 index 0000000..059fcc2 --- /dev/null +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "2a69a8ab-cea0-4c75-92d5-9495cb740e0f", + "implements": [ + "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91" + ], + "load_selection": null, + "name": "CanDelete", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J4.Model.CanDelete", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFour.Model.CanDelete", + "description": "Model Can Delete Class for Joomla 4\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md new file mode 100644 index 0000000..6c1cd82 --- /dev/null +++ b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class InputButton (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree** +```uml +@startuml +class InputButton << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Placeholder $placeholder + # Permission $permission + + __construct(Config $config, Placeholder $placeholder, ...) + + get(array $fieldData) : string +} + +note right of InputButton::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Placeholder $placeholder + Permission $permission +end note + +note right of InputButton::get + get Add Button To List Field Input (getInput tweak) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php new file mode 100644 index 0000000..fb3ac3a --- /dev/null +++ b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php @@ -0,0 +1,339 @@ + + * @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 VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface; + + +/** + * Compiler Field Input Button + * + * @since 3.2.0 + */ +final class InputButton implements InputButtonInterface +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Permission $permission) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->permission = $permission; + } + + /** + * get Add Button To List Field Input (getInput tweak) + * + * @param array $fieldData The field custom data + * + * @return string of getInput class on success empty string otherwise + * @since 3.2.0 + */ + public function get(array $fieldData): string + { + // make sure hte view values are set + if (isset($fieldData['add_button']) + && ($fieldData['add_button'] === 'true' + || 1 == $fieldData['add_button']) + && isset($fieldData['view']) + && isset($fieldData['views']) + && StringHelper::check($fieldData['view']) + && StringHelper::check($fieldData['views'])) + { + // set local component + $local_component = "com_" . $this->config->component_code_name; + // check that the component value is set + if (!isset($fieldData['component']) + || !StringHelper::check( + $fieldData['component'] + )) + { + $fieldData['component'] = $local_component; + } + // check that the component has the com_ value in it + if (strpos((string) $fieldData['component'], 'com_') === false + || strpos((string) $fieldData['component'], '=') !== false) + { + $fieldData['component'] = "com_" . $fieldData['component']; + } + // make sure the component is update if # # # or [ [ [ component placeholder is used + if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false + || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but + { + $fieldData['component'] = $this->placeholder->update_( + $fieldData['component'] + ); + } + // get core permissions + $coreLoad = false; + // add ref tags + $refLoad = true; + // fall back on the field component + $component = $fieldData['component']; + // check if we should add ref tags (since it only works well on local views) + if ($local_component !== $component) + { + // do not add ref tags + $refLoad = false; + } + // start building the add buttons/s + $addButton = array(); + $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addButton[] = Indent::_(1) . " * Override to add new button"; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) + . " * @return string The field input markup."; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @since 3.2"; + $addButton[] = Indent::_(1) . " */"; + $addButton[] = Indent::_(1) . "protected function getInput()"; + $addButton[] = Indent::_(1) . "{"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " see if we should add buttons"; + $addButton[] = Indent::_(2) + . "\$set_button = \$this->getAttribute('button');"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get html"; + $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " if true set button"; + $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; + $addButton[] = Indent::_(2) . "{"; + $addButton[] = Indent::_(3) . "\$button = array();"; + $addButton[] = Indent::_(3) . "\$script = array();"; + $addButton[] = Indent::_(3) + . "\$button_code_name = \$this->getAttribute('name');"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the input from url"; + $addButton[] = Indent::_(3) . "\$app = Factory::getApplication();"; + $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the view name & id"; + $addButton[] = Indent::_(3) + . "\$values = \$jinput->getArray(array("; + $addButton[] = Indent::_(4) . "'id' => 'int',"; + $addButton[] = Indent::_(4) . "'view' => 'word'"; + $addButton[] = Indent::_(3) . "));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if new item"; + $addButton[] = Indent::_(3) . "\$ref = '';"; + $addButton[] = Indent::_(3) . "\$refJ = '';"; + if ($refLoad) + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load referral if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref .= '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ .= '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + else + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load field details if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref = '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ = '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get button label"; + $addButton[] = Indent::_(3) + . "\$button_label = trim(\$button_code_name);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = ucfirst(strtolower(\$button_label));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get user object"; + $addButton[] = Indent::_(3) . "\$user = Factory::getUser();"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to create " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.create') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build Create button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to edit " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.edit') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build edit button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build script"; + $addButton[] = Indent::_(4) . "\$script[] = \""; + $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {"; + $addButton[] = Indent::_(6) + . "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {"; + $addButton[] = Indent::_(7) . "e.preventDefault();"; + $addButton[] = Indent::_(7) + . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; + $addButton[] = Indent::_(7) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(6) . "});"; + $addButton[] = Indent::_(6) + . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; + $addButton[] = Indent::_(6) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(5) . "});"; + $addButton[] = Indent::_(5) + . "function \".\$button_code_name.\"Button(value) {"; + $addButton[] = Indent::_(6) + . "if (value > 0) {"; // TODO not ideal since value may not be an (int) + $addButton[] = Indent::_(7) . "// hide the create button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Create').hide();"; + $addButton[] = Indent::_(7) . "// show edit button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').show();"; + $addButton[] = Indent::_(7) . "var url = 'index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['views'] + . "&task=" . $fieldData['view'] + . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);"; + $addButton[] = Indent::_(6) . "} else {"; + $addButton[] = Indent::_(7) . "// show the create button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Create').show();"; + $addButton[] = Indent::_(7) . "// hide edit button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').hide();"; + $addButton[] = Indent::_(6) . "}"; + $addButton[] = Indent::_(5) . "}\";"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if button was created for " . $fieldData['view'] + . " field."; + $addButton[] = Indent::_(3) + . "if (is_array(\$button) && count(\$button) > 0)"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " Load the needed script."; + $addButton[] = Indent::_(4) + . "\$document = Factory::getDocument();"; + $addButton[] = Indent::_(4) + . "\$document->addScriptDeclaration(implode(' ',\$script));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " return the button attached to input field."; + $addButton[] = Indent::_(4) + . "return '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } +} + diff --git a/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power new file mode 100644 index 0000000..aa6450e --- /dev/null +++ b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power @@ -0,0 +1,306 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Permission $permission) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->permission = $permission; + } + + /** + * get Add Button To List Field Input (getInput tweak) + * + * @param array $fieldData The field custom data + * + * @return string of getInput class on success empty string otherwise + * @since 3.2.0 + */ + public function get(array $fieldData): string + { + // make sure hte view values are set + if (isset($fieldData['add_button']) + && ($fieldData['add_button'] === 'true' + || 1 == $fieldData['add_button']) + && isset($fieldData['view']) + && isset($fieldData['views']) + && StringHelper::check($fieldData['view']) + && StringHelper::check($fieldData['views'])) + { + // set local component + $local_component = "com_" . $this->config->component_code_name; + // check that the component value is set + if (!isset($fieldData['component']) + || !StringHelper::check( + $fieldData['component'] + )) + { + $fieldData['component'] = $local_component; + } + // check that the component has the com_ value in it + if (strpos((string) $fieldData['component'], 'com_') === false + || strpos((string) $fieldData['component'], '=') !== false) + { + $fieldData['component'] = "com_" . $fieldData['component']; + } + // make sure the component is update if # # # or [ [ [ component placeholder is used + if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false + || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but + { + $fieldData['component'] = $this->placeholder->update_( + $fieldData['component'] + ); + } + // get core permissions + $coreLoad = false; + // add ref tags + $refLoad = true; + // fall back on the field component + $component = $fieldData['component']; + // check if we should add ref tags (since it only works well on local views) + if ($local_component !== $component) + { + // do not add ref tags + $refLoad = false; + } + // start building the add buttons/s + $addButton = array(); + $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addButton[] = Indent::_(1) . " * Override to add new button"; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) + . " * @return string The field input markup."; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @since 3.2"; + $addButton[] = Indent::_(1) . " */"; + $addButton[] = Indent::_(1) . "protected function getInput()"; + $addButton[] = Indent::_(1) . "{"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " see if we should add buttons"; + $addButton[] = Indent::_(2) + . "\$set_button = \$this->getAttribute('button');"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get html"; + $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " if true set button"; + $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; + $addButton[] = Indent::_(2) . "{"; + $addButton[] = Indent::_(3) . "\$button = array();"; + $addButton[] = Indent::_(3) . "\$script = array();"; + $addButton[] = Indent::_(3) + . "\$button_code_name = \$this->getAttribute('name');"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the input from url"; + $addButton[] = Indent::_(3) . "\$app = Factory::getApplication();"; + $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get the view name & id"; + $addButton[] = Indent::_(3) + . "\$values = \$jinput->getArray(array("; + $addButton[] = Indent::_(4) . "'id' => 'int',"; + $addButton[] = Indent::_(4) . "'view' => 'word'"; + $addButton[] = Indent::_(3) . "));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if new item"; + $addButton[] = Indent::_(3) . "\$ref = '';"; + $addButton[] = Indent::_(3) . "\$refJ = '';"; + if ($refLoad) + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load referral if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref .= '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ .= '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + else + { + $addButton[] = Indent::_(3) + . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " only load field details if not new item."; + $addButton[] = Indent::_(4) + . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) + . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " get the return value."; + $addButton[] = Indent::_(4) + . "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();"; + $addButton[] = Indent::_(4) + . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " load return value."; + $addButton[] = Indent::_(4) + . "\$ref = '&return=' . \$_return;"; + $addButton[] = Indent::_(4) + . "\$refJ = '&return=' . \$_return;"; + $addButton[] = Indent::_(3) . "}"; + } + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get button label"; + $addButton[] = Indent::_(3) + . "\$button_label = trim(\$button_code_name);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; + $addButton[] = Indent::_(3) + . "\$button_label = ucfirst(strtolower(\$button_label));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " get user object"; + $addButton[] = Indent::_(3) . "\$user = Factory::getUser();"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to create " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.create') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build Create button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " only add if user allowed to edit " . $fieldData['view']; + // check if the item has permissions. + $addButton[] = Indent::_(3) . "if (\$user->authorise('" + . $this->permission->getGlobal($fieldData['view'], 'core.edit') + . "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area."; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build edit button"; + $addButton[] = Indent::_(4) + . "\$button[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " build script"; + $addButton[] = Indent::_(4) . "\$script[] = \""; + $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {"; + $addButton[] = Indent::_(6) + . "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {"; + $addButton[] = Indent::_(7) . "e.preventDefault();"; + $addButton[] = Indent::_(7) + . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; + $addButton[] = Indent::_(7) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(6) . "});"; + $addButton[] = Indent::_(6) + . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; + $addButton[] = Indent::_(6) + . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; + $addButton[] = Indent::_(5) . "});"; + $addButton[] = Indent::_(5) + . "function \".\$button_code_name.\"Button(value) {"; + $addButton[] = Indent::_(6) + . "if (value > 0) {"; // TODO not ideal since value may not be an (int) + $addButton[] = Indent::_(7) . "// hide the create button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Create').hide();"; + $addButton[] = Indent::_(7) . "// show edit button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').show();"; + $addButton[] = Indent::_(7) . "var url = 'index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['views'] + . "&task=" . $fieldData['view'] + . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);"; + $addButton[] = Indent::_(6) . "} else {"; + $addButton[] = Indent::_(7) . "// show the create button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Create').show();"; + $addButton[] = Indent::_(7) . "// hide edit button"; + $addButton[] = Indent::_(7) + . "jQuery('#\".\$button_code_name.\"Edit').hide();"; + $addButton[] = Indent::_(6) . "}"; + $addButton[] = Indent::_(5) . "}\";"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " check if button was created for " . $fieldData['view'] + . " field."; + $addButton[] = Indent::_(3) + . "if (is_array(\$button) && count(\$button) > 0)"; + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " Load the needed script."; + $addButton[] = Indent::_(4) + . "\$document = Factory::getDocument();"; + $addButton[] = Indent::_(4) + . "\$document->addScriptDeclaration(implode(' ',\$script));"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) + . " return the button attached to input field."; + $addButton[] = Indent::_(4) + . "return '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } \ No newline at end of file diff --git a/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json new file mode 100644 index 0000000..f5b08b0 --- /dev/null +++ b/src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "2bc33733-e900-4a9c-8cb3-c537aa9db785", + "implements": [ + "c600f58c-3fe2-4d2d-b711-2660eab6effe" + ], + "load_selection": null, + "name": "InputButton", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J3.InputButton", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection2": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.InputButton", + "description": "Compiler Field Input Button\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md index 4eeac6f..a8b0409 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md @@ -14,6 +14,7 @@ class Builder #Gold { + register(Container $container) : void + getAccessSwitch(Container $container) : AccessSwitch + getAccessSwitchList(Container $container) : AccessSwitchList + + getAssetsRules(Container $container) : AssetsRules + getAdminFilterType(Container $container) : AdminFilterType + getAlias(Container $container) : Alias + getBaseSixFour(Container $container) : BaseSixFour @@ -22,8 +23,11 @@ class Builder #Gold { + getCategoryOtherName(Container $container) : CategoryOtherName + getCheckBox(Container $container) : CheckBox + getComponentFields(Container $container) : ComponentFields + + getConfigFieldsets(Container $container) : ConfigFieldsets + + getConfigFieldsetsCustomfield(Container $container) : ConfigFieldsetsCustomfield + getContentMulti(Container $container) : ContentMulti + getContentOne(Container $container) : ContentOne + + getContributors(Container $container) : Contributors + getCustomAlias(Container $container) : CustomAlias + getCustomField(Container $container) : CustomField + getCustomFieldLinks(Container $container) : CustomFieldLinks @@ -36,14 +40,17 @@ class Builder #Gold { + getDoNotEscape(Container $container) : DoNotEscape + getDynamicFields(Container $container) : DynamicFields + getExtensionCustomFields(Container $container) : ExtensionCustomFields + + getExtensionsParams(Container $container) : ExtensionsParams + getFieldGroupControl(Container $container) : FieldGroupControl + getFieldNames(Container $container) : FieldNames + getFieldRelations(Container $container) : FieldRelations + getFilter(Container $container) : Filter + getFootableScripts(Container $container) : FootableScripts + + getFrontendParams(Container $container) : FrontendParams + getGetAsLookup(Container $container) : GetAsLookup + getGetModule(Container $container) : GetModule + getGoogleChart(Container $container) : GoogleChart + + getHasMenuGlobal(Container $container) : HasMenuGlobal + getHasPermissions(Container $container) : HasPermissions + getHiddenFields(Container $container) : HiddenFields + getHistory(Container $container) : History @@ -53,6 +60,7 @@ class Builder #Gold { + getJsonItem(Container $container) : JsonItem + getJsonItemArray(Container $container) : JsonItemArray + getJsonString(Container $container) : JsonString + + getLanguageMessages(Container $container) : LanguageMessages + getLayout(Container $container) : Layout + getLayoutData(Container $container) : LayoutData + getLibraryManager(Container $container) : LibraryManager @@ -81,8 +89,10 @@ class Builder #Gold { + getPermissionComponent(Container $container) : PermissionComponent + getPermissionCore(Container $container) : PermissionCore + getPermissionDashboard(Container $container) : PermissionDashboard + + getPermissionFields(Container $container) : PermissionFields + getPermissionGlobalAction(Container $container) : PermissionGlobalAction + getPermissionViews(Container $container) : PermissionViews + + getRequest(Container $container) : Request + getScriptMediaSwitch(Container $container) : ScriptMediaSwitch + getScriptUserSwitch(Container $container) : ScriptUserSwitch + getSearch(Container $container) : Search @@ -101,6 +111,7 @@ class Builder #Gold { + getTitle(Container $container) : Title + getUikitComp(Container $container) : UikitComp + getUpdateMysql(Container $container) : UpdateMysql + + getViewsDefaultOrdering(Container $container) : ViewsDefaultOrdering } note right of Builder::register @@ -124,76 +135,104 @@ note right of Builder::getAccessSwitchList return: AccessSwitchList end note -note left of Builder::getAdminFilterType +note left of Builder::getAssetsRules + Get The AssetsRules Class. + + since: 3.2.0 + return: AssetsRules +end note + +note right of Builder::getAdminFilterType Get The AdminFilterType Class. since: 3.2.0 return: AdminFilterType end note -note right of Builder::getAlias +note left of Builder::getAlias Get The Alias Class. since: 3.2.0 return: Alias end note -note left of Builder::getBaseSixFour +note right of Builder::getBaseSixFour Get The BaseSixFour Class. since: 3.2.0 return: BaseSixFour end note -note right of Builder::getCategory +note left of Builder::getCategory Get The Category Class. since: 3.2.0 return: Category end note -note left of Builder::getCategoryCode +note right of Builder::getCategoryCode Get The CategoryCode Class. since: 3.2.0 return: CategoryCode end note -note right of Builder::getCategoryOtherName +note left of Builder::getCategoryOtherName Get The CategoryOtherName Class. since: 3.2.0 return: CategoryOtherName end note -note left of Builder::getCheckBox +note right of Builder::getCheckBox Get The CheckBox Class. since: 3.2.0 return: CheckBox end note -note right of Builder::getComponentFields +note left of Builder::getComponentFields Get The ComponentFields Class. since: 3.2.0 return: ComponentFields end note -note left of Builder::getContentMulti +note right of Builder::getConfigFieldsets + Get The ConfigFieldsets Class. + + since: 3.2.0 + return: ConfigFieldsets +end note + +note left of Builder::getConfigFieldsetsCustomfield + Get The ConfigFieldsetsCustomfield Class. + + since: 3.2.0 + return: ConfigFieldsetsCustomfield +end note + +note right of Builder::getContentMulti Get The ContentMulti Class. since: 3.2.0 return: ContentMulti end note -note right of Builder::getContentOne +note left of Builder::getContentOne Get The ContentOne Class. since: 3.2.0 return: ContentOne end note +note right of Builder::getContributors + Get The Contributors Class. + + since: 3.2.0 + return: Contributors +end note + note left of Builder::getCustomAlias Get The CustomAlias Class. @@ -278,41 +317,55 @@ note right of Builder::getExtensionCustomFields return: ExtensionCustomFields end note -note left of Builder::getFieldGroupControl +note left of Builder::getExtensionsParams + Get The ExtensionsParams Class. + + since: 3.2.0 + return: ExtensionsParams +end note + +note right of Builder::getFieldGroupControl Get The FieldGroupControl Class. since: 3.2.0 return: FieldGroupControl end note -note right of Builder::getFieldNames +note left of Builder::getFieldNames Get The FieldNames Class. since: 3.2.0 return: FieldNames end note -note left of Builder::getFieldRelations +note right of Builder::getFieldRelations Get The FieldRelations Class. since: 3.2.0 return: FieldRelations end note -note right of Builder::getFilter +note left of Builder::getFilter Get The Filter Class. since: 3.2.0 return: Filter end note -note left of Builder::getFootableScripts +note right of Builder::getFootableScripts Get The FootableScripts Class. since: 3.2.0 return: FootableScripts end note +note left of Builder::getFrontendParams + Get The FrontendParams Class. + + since: 3.2.0 + return: FrontendParams +end note + note right of Builder::getGetAsLookup Get The GetAsLookup Class. @@ -334,69 +387,83 @@ note right of Builder::getGoogleChart return: GoogleChart end note -note left of Builder::getHasPermissions +note left of Builder::getHasMenuGlobal + Get The HasMenuGlobal Class. + + since: 3.2.0 + return: HasMenuGlobal +end note + +note right of Builder::getHasPermissions Get The HasPermissions Class. since: 3.2.0 return: HasPermissions end note -note right of Builder::getHiddenFields +note left of Builder::getHiddenFields Get The HiddenFields Class. since: 3.2.0 return: HiddenFields end note -note left of Builder::getHistory +note right of Builder::getHistory Get The History Class. since: 3.2.0 return: History end note -note right of Builder::getIntegerFields +note left of Builder::getIntegerFields Get The IntegerFields Class. since: 3.2.0 return: IntegerFields end note -note left of Builder::getItemsMethodEximportString +note right of Builder::getItemsMethodEximportString Get The ItemsMethodEximportString Class. since: 3.2.0 return: ItemsMethodEximportString end note -note right of Builder::getItemsMethodListString +note left of Builder::getItemsMethodListString Get The ItemsMethodListString Class. since: 3.2.0 return: ItemsMethodListString end note -note left of Builder::getJsonItem +note right of Builder::getJsonItem Get The JsonItem Class. since: 3.2.0 return: JsonItem end note -note right of Builder::getJsonItemArray +note left of Builder::getJsonItemArray Get The JsonItemArray Class. since: 3.2.0 return: JsonItemArray end note -note left of Builder::getJsonString +note right of Builder::getJsonString Get The JsonString Class. since: 3.2.0 return: JsonString end note +note left of Builder::getLanguageMessages + Get The LanguageMessages Class. + + since: 3.2.0 + return: LanguageMessages +end note + note right of Builder::getLayout Get The Layout Class. @@ -593,20 +660,34 @@ note left of Builder::getPermissionDashboard return: PermissionDashboard end note -note right of Builder::getPermissionGlobalAction +note right of Builder::getPermissionFields + Get The PermissionFields Class. + + since: 3.2.0 + return: PermissionFields +end note + +note left of Builder::getPermissionGlobalAction Get The PermissionGlobalAction Class. since: 3.2.0 return: PermissionGlobalAction end note -note left of Builder::getPermissionViews +note right of Builder::getPermissionViews Get The PermissionViews Class. since: 3.2.0 return: PermissionViews end note +note left of Builder::getRequest + Get The Request Class. + + since: 3.2.0 + return: Request +end note + note right of Builder::getScriptMediaSwitch Get The ScriptMediaSwitch Class. @@ -732,6 +813,13 @@ note left of Builder::getUpdateMysql since: 3.2.0 return: UpdateMysql end note + +note right of Builder::getViewsDefaultOrdering + Get The ViewsDefaultOrdering Class. + + since: 3.2.0 + return: ViewsDefaultOrdering +end note @enduml ``` diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php index 8e5f735..3642c47 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php @@ -16,6 +16,7 @@ use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; @@ -24,8 +25,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; @@ -38,14 +42,17 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\History; @@ -55,6 +62,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\LanguageMessages; use VDM\Joomla\Componentbuilder\Compiler\Builder\Layout; use VDM\Joomla\Componentbuilder\Compiler\Builder\LayoutData; use VDM\Joomla\Componentbuilder\Compiler\Builder\LibraryManager; @@ -83,8 +91,10 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionCore; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionDashboard; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionGlobalAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Request; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptMediaSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptUserSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\Search; @@ -103,6 +113,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\TemplateData; use VDM\Joomla\Componentbuilder\Compiler\Builder\Title; use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; use VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ViewsDefaultOrdering; /** @@ -112,1439 +123,1615 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql; */ 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(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); - - $container->alias(Layout::class, 'Compiler.Builder.Layout') - ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); - - $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') - ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); - - $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') - ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); - - $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') - ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); - - $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') - ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); - - $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') - ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); - - $container->alias(Lists::class, 'Compiler.Builder.Lists') - ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); - - $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') - ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); - - $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') - ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); - - $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') - ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); - - $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') - ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); - - $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') - ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); - - $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') - ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); - - $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') - ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); - - $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') - ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); - - $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') - ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); - - $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') - ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); - - $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') - ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); - - $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') - ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); - - $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') - ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); - - $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') - ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); - - $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') - ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); - - $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') - ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); - - $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') - ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); - - $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') - ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); - - $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') - ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); - - $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') - ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); - - $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') - ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); - - $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') - ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); - - $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') - ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); - - $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') - ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); - - $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') - ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); - - $container->alias(Search::class, 'Compiler.Builder.Search') - ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); - - $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') - ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); - - $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') - ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); - - $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') - ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); - - $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') - ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); - - $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') - ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); - - $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') - ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); - - $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') - ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); - - $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') - ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); - - $container->alias(Sort::class, 'Compiler.Builder.Sort') - ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); - - $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') - ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); - - $container->alias(Tags::class, 'Compiler.Builder.Tags') - ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); - - $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') - ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); - - $container->alias(Title::class, 'Compiler.Builder.Title') - ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); - - $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') - ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); - - $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') - ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); - } - - /** - * Get The AccessSwitch Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitch - * @since 3.2.0 - */ - public function getAccessSwitch(Container $container): AccessSwitch - { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); - } - - /** - * Get The Layout Class. - * - * @param Container $container The DI container. - * - * @return Layout - * @since 3.2.0 - */ - public function getLayout(Container $container): Layout - { - return new Layout(); - } - - /** - * Get The LayoutData Class. - * - * @param Container $container The DI container. - * - * @return LayoutData - * @since 3.2.0 - */ - public function getLayoutData(Container $container): LayoutData - { - return new LayoutData(); - } - - /** - * Get The LibraryManager Class. - * - * @param Container $container The DI container. - * - * @return LibraryManager - * @since 3.2.0 - */ - public function getLibraryManager(Container $container): LibraryManager - { - return new LibraryManager(); - } - - /** - * Get The ListFieldClass Class. - * - * @param Container $container The DI container. - * - * @return ListFieldClass - * @since 3.2.0 - */ - public function getListFieldClass(Container $container): ListFieldClass - { - return new ListFieldClass(); - } - - /** - * Get The ListHeadOverride Class. - * - * @param Container $container The DI container. - * - * @return ListHeadOverride - * @since 3.2.0 - */ - public function getListHeadOverride(Container $container): ListHeadOverride - { - return new ListHeadOverride(); - } - - /** - * Get The ListJoin Class. - * - * @param Container $container The DI container. - * - * @return ListJoin - * @since 3.2.0 - */ - public function getListJoin(Container $container): ListJoin - { - return new ListJoin(); - } - - /** - * Get The Lists Class. - * - * @param Container $container The DI container. - * - * @return Lists - * @since 3.2.0 - */ - public function getLists(Container $container): Lists - { - return new Lists(); - } - - /** - * Get The MainTextField Class. - * - * @param Container $container The DI container. - * - * @return MainTextField - * @since 3.2.0 - */ - public function getMainTextField(Container $container): MainTextField - { - return new MainTextField(); - } - - /** - * Get The MetaData Class. - * - * @param Container $container The DI container. - * - * @return MetaData - * @since 3.2.0 - */ - public function getMetaData(Container $container): MetaData - { - return new MetaData(); - } - - /** - * Get The ModelBasicField Class. - * - * @param Container $container The DI container. - * - * @return ModelBasicField - * @since 3.2.0 - */ - public function getModelBasicField(Container $container): ModelBasicField - { - return new ModelBasicField(); - } - - /** - * Get The ModelExpertField Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertField - * @since 3.2.0 - */ - public function getModelExpertField(Container $container): ModelExpertField - { - return new ModelExpertField(); - } - - /** - * Get The ModelExpertFieldInitiator Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertFieldInitiator - * @since 3.2.0 - */ - public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator - { - return new ModelExpertFieldInitiator(); - } - - /** - * Get The ModelMediumField Class. - * - * @param Container $container The DI container. - * - * @return ModelMediumField - * @since 3.2.0 - */ - public function getModelMediumField(Container $container): ModelMediumField - { - return new ModelMediumField(); - } - - /** - * Get The ModelWhmcsField Class. - * - * @param Container $container The DI container. - * - * @return ModelWhmcsField - * @since 3.2.0 - */ - public function getModelWhmcsField(Container $container): ModelWhmcsField - { - return new ModelWhmcsField(); - } - - /** - * Get The MovedPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return MovedPublishingFields - * @since 3.2.0 - */ - public function getMovedPublishingFields(Container $container): MovedPublishingFields - { - return new MovedPublishingFields(); - } - - /** - * Get The MysqlTableSetting Class. - * - * @param Container $container The DI container. - * - * @return MysqlTableSetting - * @since 3.2.0 - */ - public function getMysqlTableSetting(Container $container): MysqlTableSetting - { - return new MysqlTableSetting(); - } - - /** - * Get The NewPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return NewPublishingFields - * @since 3.2.0 - */ - public function getNewPublishingFields(Container $container): NewPublishingFields - { - return new NewPublishingFields(); - } - - /** - * Get The OrderZero Class. - * - * @param Container $container The DI container. - * - * @return OrderZero - * @since 3.2.0 - */ - public function getOrderZero(Container $container): OrderZero - { - return new OrderZero(); - } - - /** - * Get The OtherFilter Class. - * - * @param Container $container The DI container. - * - * @return OtherFilter - * @since 3.2.0 - */ - public function getOtherFilter(Container $container): OtherFilter - { - return new OtherFilter(); - } - - /** - * Get The OtherGroup Class. - * - * @param Container $container The DI container. - * - * @return OtherGroup - * @since 3.2.0 - */ - public function getOtherGroup(Container $container): OtherGroup - { - return new OtherGroup(); - } - - /** - * Get The OtherJoin Class. - * - * @param Container $container The DI container. - * - * @return OtherJoin - * @since 3.2.0 - */ - public function getOtherJoin(Container $container): OtherJoin - { - return new OtherJoin(); - } - - /** - * Get The OtherOrder Class. - * - * @param Container $container The DI container. - * - * @return OtherOrder - * @since 3.2.0 - */ - public function getOtherOrder(Container $container): OtherOrder - { - return new OtherOrder(); - } - - /** - * Get The OtherQuery Class. - * - * @param Container $container The DI container. - * - * @return OtherQuery - * @since 3.2.0 - */ - public function getOtherQuery(Container $container): OtherQuery - { - return new OtherQuery(); - } - - /** - * Get The OtherWhere Class. - * - * @param Container $container The DI container. - * - * @return OtherWhere - * @since 3.2.0 - */ - public function getOtherWhere(Container $container): OtherWhere - { - return new OtherWhere(); - } - - /** - * Get The PermissionAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionAction - * @since 3.2.0 - */ - public function getPermissionAction(Container $container): PermissionAction - { - return new PermissionAction(); - } - - /** - * Get The PermissionComponent Class. - * - * @param Container $container The DI container. - * - * @return PermissionComponent - * @since 3.2.0 - */ - public function getPermissionComponent(Container $container): PermissionComponent - { - return new PermissionComponent(); - } - - /** - * Get The PermissionCore Class. - * - * @param Container $container The DI container. - * - * @return PermissionCore - * @since 3.2.0 - */ - public function getPermissionCore(Container $container): PermissionCore - { - return new PermissionCore(); - } - - /** - * Get The PermissionDashboard Class. - * - * @param Container $container The DI container. - * - * @return PermissionDashboard - * @since 3.2.0 - */ - public function getPermissionDashboard(Container $container): PermissionDashboard - { - return new PermissionDashboard(); - } - - /** - * Get The PermissionGlobalAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionGlobalAction - * @since 3.2.0 - */ - public function getPermissionGlobalAction(Container $container): PermissionGlobalAction - { - return new PermissionGlobalAction(); - } - - /** - * Get The PermissionViews Class. - * - * @param Container $container The DI container. - * - * @return PermissionViews - * @since 3.2.0 - */ - public function getPermissionViews(Container $container): PermissionViews - { - return new PermissionViews(); - } - - /** - * Get The ScriptMediaSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptMediaSwitch - * @since 3.2.0 - */ - public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch - { - return new ScriptMediaSwitch(); - } - - /** - * Get The ScriptUserSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptUserSwitch - * @since 3.2.0 - */ - public function getScriptUserSwitch(Container $container): ScriptUserSwitch - { - return new ScriptUserSwitch(); - } - - /** - * Get The Search Class. - * - * @param Container $container The DI container. - * - * @return Search - * @since 3.2.0 - */ - public function getSearch(Container $container): Search - { - return new Search(); - } - - /** - * Get The SelectionTranslation Class. - * - * @param Container $container The DI container. - * - * @return SelectionTranslation - * @since 3.2.0 - */ - public function getSelectionTranslation(Container $container): SelectionTranslation - { - return new SelectionTranslation(); - } - - /** - * Get The SiteDecrypt Class. - * - * @param Container $container The DI container. - * - * @return SiteDecrypt - * @since 3.2.0 - */ - public function getSiteDecrypt(Container $container): SiteDecrypt - { - return new SiteDecrypt(); - } - - /** - * Get The SiteDynamicGet Class. - * - * @param Container $container The DI container. - * - * @return SiteDynamicGet - * @since 3.2.0 - */ - public function getSiteDynamicGet(Container $container): SiteDynamicGet - { - return new SiteDynamicGet(); - } - - /** - * Get The SiteEditView Class. - * - * @param Container $container The DI container. - * - * @return SiteEditView - * @since 3.2.0 - */ - public function getSiteEditView(Container $container): SiteEditView - { - return new SiteEditView(); - } - - /** - * Get The SiteFieldData Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldData - * @since 3.2.0 - */ - public function getSiteFieldData(Container $container): SiteFieldData - { - return new SiteFieldData(); - } - - /** - * Get The SiteFieldDecodeFilter Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldDecodeFilter - * @since 3.2.0 - */ - public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter - { - return new SiteFieldDecodeFilter(); - } - - /** - * Get The SiteFields Class. - * - * @param Container $container The DI container. - * - * @return SiteFields - * @since 3.2.0 - */ - public function getSiteFields(Container $container): SiteFields - { - return new SiteFields(); - } - - /** - * Get The SiteMainGet Class. - * - * @param Container $container The DI container. - * - * @return SiteMainGet - * @since 3.2.0 - */ - public function getSiteMainGet(Container $container): SiteMainGet - { - return new SiteMainGet(); - } - - /** - * Get The Sort Class. - * - * @param Container $container The DI container. - * - * @return Sort - * @since 3.2.0 - */ - public function getSort(Container $container): Sort - { - return new Sort(); - } - - /** - * Get The TabCounter Class. - * - * @param Container $container The DI container. - * - * @return TabCounter - * @since 3.2.0 - */ - public function getTabCounter(Container $container): TabCounter - { - return new TabCounter(); - } - - /** - * Get The Tags Class. - * - * @param Container $container The DI container. - * - * @return Tags - * @since 3.2.0 - */ - public function getTags(Container $container): Tags - { - return new Tags(); - } - - /** - * Get The TemplateData Class. - * - * @param Container $container The DI container. - * - * @return TemplateData - * @since 3.2.0 - */ - public function getTemplateData(Container $container): TemplateData - { - return new TemplateData(); - } - - /** - * Get The Title Class. - * - * @param Container $container The DI container. - * - * @return Title - * @since 3.2.0 - */ - public function getTitle(Container $container): Title - { - return new Title(); - } - - /** - * Get The UikitComp Class. - * - * @param Container $container The DI container. - * - * @return UikitComp - * @since 3.2.0 - */ - public function getUikitComp(Container $container): UikitComp - { - return new UikitComp(); - } - - /** - * Get The UpdateMysql Class. - * - * @param Container $container The DI container. - * - * @return UpdateMysql - * @since 3.2.0 - */ - public function getUpdateMysql(Container $container): UpdateMysql - { - return new UpdateMysql(); + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); + + $container->alias(Layout::class, 'Compiler.Builder.Layout') + ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); + + $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') + ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); + + $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') + ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); + + $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') + ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); + + $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') + ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); + + $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') + ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); + + $container->alias(Lists::class, 'Compiler.Builder.Lists') + ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); + + $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') + ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); + + $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') + ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); + + $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') + ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); + + $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') + ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); + + $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') + ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); + + $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') + ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); + + $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') + ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); + + $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') + ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); + + $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') + ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); + + $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') + ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); + + $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') + ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); + + $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') + ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); + + $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') + ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); + + $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') + ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); + + $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') + ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); + + $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') + ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); + + $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') + ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); + + $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') + ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); + + $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') + ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); + + $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') + ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); + + $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') + ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') + ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); + + $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') + ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') + ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); + + $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') + ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); + + $container->alias(Search::class, 'Compiler.Builder.Search') + ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); + + $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') + ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); + + $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') + ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); + + $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') + ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); + + $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') + ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); + + $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') + ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); + + $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') + ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); + + $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') + ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); + + $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') + ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); + + $container->alias(Sort::class, 'Compiler.Builder.Sort') + ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); + + $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') + ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); + + $container->alias(Tags::class, 'Compiler.Builder.Tags') + ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); + + $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') + ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); + + $container->alias(Title::class, 'Compiler.Builder.Title') + ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); + + $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') + ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); + + $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') + ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } + + /** + * Get The LanguageMessages Class. + * + * @param Container $container The DI container. + * + * @return LanguageMessages + * @since 3.2.0 + */ + public function getLanguageMessages(Container $container): LanguageMessages + { + return new LanguageMessages(); + } + + /** + * Get The Layout Class. + * + * @param Container $container The DI container. + * + * @return Layout + * @since 3.2.0 + */ + public function getLayout(Container $container): Layout + { + return new Layout(); + } + + /** + * Get The LayoutData Class. + * + * @param Container $container The DI container. + * + * @return LayoutData + * @since 3.2.0 + */ + public function getLayoutData(Container $container): LayoutData + { + return new LayoutData(); + } + + /** + * Get The LibraryManager Class. + * + * @param Container $container The DI container. + * + * @return LibraryManager + * @since 3.2.0 + */ + public function getLibraryManager(Container $container): LibraryManager + { + return new LibraryManager(); + } + + /** + * Get The ListFieldClass Class. + * + * @param Container $container The DI container. + * + * @return ListFieldClass + * @since 3.2.0 + */ + public function getListFieldClass(Container $container): ListFieldClass + { + return new ListFieldClass(); + } + + /** + * Get The ListHeadOverride Class. + * + * @param Container $container The DI container. + * + * @return ListHeadOverride + * @since 3.2.0 + */ + public function getListHeadOverride(Container $container): ListHeadOverride + { + return new ListHeadOverride(); + } + + /** + * Get The ListJoin Class. + * + * @param Container $container The DI container. + * + * @return ListJoin + * @since 3.2.0 + */ + public function getListJoin(Container $container): ListJoin + { + return new ListJoin(); + } + + /** + * Get The Lists Class. + * + * @param Container $container The DI container. + * + * @return Lists + * @since 3.2.0 + */ + public function getLists(Container $container): Lists + { + return new Lists(); + } + + /** + * Get The MainTextField Class. + * + * @param Container $container The DI container. + * + * @return MainTextField + * @since 3.2.0 + */ + public function getMainTextField(Container $container): MainTextField + { + return new MainTextField(); + } + + /** + * Get The MetaData Class. + * + * @param Container $container The DI container. + * + * @return MetaData + * @since 3.2.0 + */ + public function getMetaData(Container $container): MetaData + { + return new MetaData(); + } + + /** + * Get The ModelBasicField Class. + * + * @param Container $container The DI container. + * + * @return ModelBasicField + * @since 3.2.0 + */ + public function getModelBasicField(Container $container): ModelBasicField + { + return new ModelBasicField(); + } + + /** + * Get The ModelExpertField Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertField + * @since 3.2.0 + */ + public function getModelExpertField(Container $container): ModelExpertField + { + return new ModelExpertField(); + } + + /** + * Get The ModelExpertFieldInitiator Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertFieldInitiator + * @since 3.2.0 + */ + public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator + { + return new ModelExpertFieldInitiator(); + } + + /** + * Get The ModelMediumField Class. + * + * @param Container $container The DI container. + * + * @return ModelMediumField + * @since 3.2.0 + */ + public function getModelMediumField(Container $container): ModelMediumField + { + return new ModelMediumField(); + } + + /** + * Get The ModelWhmcsField Class. + * + * @param Container $container The DI container. + * + * @return ModelWhmcsField + * @since 3.2.0 + */ + public function getModelWhmcsField(Container $container): ModelWhmcsField + { + return new ModelWhmcsField(); + } + + /** + * Get The MovedPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return MovedPublishingFields + * @since 3.2.0 + */ + public function getMovedPublishingFields(Container $container): MovedPublishingFields + { + return new MovedPublishingFields(); + } + + /** + * Get The MysqlTableSetting Class. + * + * @param Container $container The DI container. + * + * @return MysqlTableSetting + * @since 3.2.0 + */ + public function getMysqlTableSetting(Container $container): MysqlTableSetting + { + return new MysqlTableSetting(); + } + + /** + * Get The NewPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return NewPublishingFields + * @since 3.2.0 + */ + public function getNewPublishingFields(Container $container): NewPublishingFields + { + return new NewPublishingFields(); + } + + /** + * Get The OrderZero Class. + * + * @param Container $container The DI container. + * + * @return OrderZero + * @since 3.2.0 + */ + public function getOrderZero(Container $container): OrderZero + { + return new OrderZero(); + } + + /** + * Get The OtherFilter Class. + * + * @param Container $container The DI container. + * + * @return OtherFilter + * @since 3.2.0 + */ + public function getOtherFilter(Container $container): OtherFilter + { + return new OtherFilter(); + } + + /** + * Get The OtherGroup Class. + * + * @param Container $container The DI container. + * + * @return OtherGroup + * @since 3.2.0 + */ + public function getOtherGroup(Container $container): OtherGroup + { + return new OtherGroup(); + } + + /** + * Get The OtherJoin Class. + * + * @param Container $container The DI container. + * + * @return OtherJoin + * @since 3.2.0 + */ + public function getOtherJoin(Container $container): OtherJoin + { + return new OtherJoin(); + } + + /** + * Get The OtherOrder Class. + * + * @param Container $container The DI container. + * + * @return OtherOrder + * @since 3.2.0 + */ + public function getOtherOrder(Container $container): OtherOrder + { + return new OtherOrder(); + } + + /** + * Get The OtherQuery Class. + * + * @param Container $container The DI container. + * + * @return OtherQuery + * @since 3.2.0 + */ + public function getOtherQuery(Container $container): OtherQuery + { + return new OtherQuery(); + } + + /** + * Get The OtherWhere Class. + * + * @param Container $container The DI container. + * + * @return OtherWhere + * @since 3.2.0 + */ + public function getOtherWhere(Container $container): OtherWhere + { + return new OtherWhere(); + } + + /** + * Get The PermissionAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionAction + * @since 3.2.0 + */ + public function getPermissionAction(Container $container): PermissionAction + { + return new PermissionAction(); + } + + /** + * Get The PermissionComponent Class. + * + * @param Container $container The DI container. + * + * @return PermissionComponent + * @since 3.2.0 + */ + public function getPermissionComponent(Container $container): PermissionComponent + { + return new PermissionComponent(); + } + + /** + * Get The PermissionCore Class. + * + * @param Container $container The DI container. + * + * @return PermissionCore + * @since 3.2.0 + */ + public function getPermissionCore(Container $container): PermissionCore + { + return new PermissionCore(); + } + + /** + * Get The PermissionDashboard Class. + * + * @param Container $container The DI container. + * + * @return PermissionDashboard + * @since 3.2.0 + */ + public function getPermissionDashboard(Container $container): PermissionDashboard + { + return new PermissionDashboard(); + } + + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + + /** + * Get The PermissionGlobalAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionGlobalAction + * @since 3.2.0 + */ + public function getPermissionGlobalAction(Container $container): PermissionGlobalAction + { + return new PermissionGlobalAction(); + } + + /** + * Get The PermissionViews Class. + * + * @param Container $container The DI container. + * + * @return PermissionViews + * @since 3.2.0 + */ + public function getPermissionViews(Container $container): PermissionViews + { + return new PermissionViews(); + } + + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * Get The ScriptMediaSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptMediaSwitch + * @since 3.2.0 + */ + public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch + { + return new ScriptMediaSwitch(); + } + + /** + * Get The ScriptUserSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptUserSwitch + * @since 3.2.0 + */ + public function getScriptUserSwitch(Container $container): ScriptUserSwitch + { + return new ScriptUserSwitch(); + } + + /** + * Get The Search Class. + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get The SelectionTranslation Class. + * + * @param Container $container The DI container. + * + * @return SelectionTranslation + * @since 3.2.0 + */ + public function getSelectionTranslation(Container $container): SelectionTranslation + { + return new SelectionTranslation(); + } + + /** + * Get The SiteDecrypt Class. + * + * @param Container $container The DI container. + * + * @return SiteDecrypt + * @since 3.2.0 + */ + public function getSiteDecrypt(Container $container): SiteDecrypt + { + return new SiteDecrypt(); + } + + /** + * Get The SiteDynamicGet Class. + * + * @param Container $container The DI container. + * + * @return SiteDynamicGet + * @since 3.2.0 + */ + public function getSiteDynamicGet(Container $container): SiteDynamicGet + { + return new SiteDynamicGet(); + } + + /** + * Get The SiteEditView Class. + * + * @param Container $container The DI container. + * + * @return SiteEditView + * @since 3.2.0 + */ + public function getSiteEditView(Container $container): SiteEditView + { + return new SiteEditView(); + } + + /** + * Get The SiteFieldData Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldData + * @since 3.2.0 + */ + public function getSiteFieldData(Container $container): SiteFieldData + { + return new SiteFieldData(); + } + + /** + * Get The SiteFieldDecodeFilter Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldDecodeFilter + * @since 3.2.0 + */ + public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter + { + return new SiteFieldDecodeFilter(); + } + + /** + * Get The SiteFields Class. + * + * @param Container $container The DI container. + * + * @return SiteFields + * @since 3.2.0 + */ + public function getSiteFields(Container $container): SiteFields + { + return new SiteFields(); + } + + /** + * Get The SiteMainGet Class. + * + * @param Container $container The DI container. + * + * @return SiteMainGet + * @since 3.2.0 + */ + public function getSiteMainGet(Container $container): SiteMainGet + { + return new SiteMainGet(); + } + + /** + * Get The Sort Class. + * + * @param Container $container The DI container. + * + * @return Sort + * @since 3.2.0 + */ + public function getSort(Container $container): Sort + { + return new Sort(); + } + + /** + * Get The TabCounter Class. + * + * @param Container $container The DI container. + * + * @return TabCounter + * @since 3.2.0 + */ + public function getTabCounter(Container $container): TabCounter + { + return new TabCounter(); + } + + /** + * Get The Tags Class. + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags(); + } + + /** + * Get The TemplateData Class. + * + * @param Container $container The DI container. + * + * @return TemplateData + * @since 3.2.0 + */ + public function getTemplateData(Container $container): TemplateData + { + return new TemplateData(); + } + + /** + * Get The Title Class. + * + * @param Container $container The DI container. + * + * @return Title + * @since 3.2.0 + */ + public function getTitle(Container $container): Title + { + return new Title(); + } + + /** + * Get The UikitComp Class. + * + * @param Container $container The DI container. + * + * @return UikitComp + * @since 3.2.0 + */ + public function getUikitComp(Container $container): UikitComp + { + return new UikitComp(); + } + + /** + * Get The UpdateMysql Class. + * + * @param Container $container The DI container. + * + * @return UpdateMysql + * @since 3.2.0 + */ + public function getUpdateMysql(Container $container): UpdateMysql + { + return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } } diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power index ecfda1a..cc6d6d1 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power @@ -1,1434 +1,1610 @@ - /** - * Registers the service provider with a DI container. - * - * @param Container $container The DI container. - * - * @return void - * @since 3.2.0 - */ - public function register(Container $container) - { - $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); - - $container->alias(Layout::class, 'Compiler.Builder.Layout') - ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); - - $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') - ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); - - $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') - ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); - - $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') - ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); - - $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') - ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); - - $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') - ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); - - $container->alias(Lists::class, 'Compiler.Builder.Lists') - ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); - - $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') - ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); - - $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') - ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); - - $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') - ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); - - $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') - ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); - - $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') - ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); - - $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') - ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); - - $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') - ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); - - $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') - ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); - - $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') - ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); - - $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') - ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); - - $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') - ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); - - $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') - ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); - - $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') - ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); - - $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') - ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); - - $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') - ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); - - $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') - ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); - - $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') - ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); - - $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') - ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); - - $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') - ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); - - $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') - ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); - - $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') - ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); - - $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') - ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); - - $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') - ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); - - $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') - ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); - - $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') - ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); - - $container->alias(Search::class, 'Compiler.Builder.Search') - ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); - - $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') - ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); - - $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') - ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); - - $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') - ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); - - $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') - ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); - - $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') - ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); - - $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') - ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); - - $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') - ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); - - $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') - ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); - - $container->alias(Sort::class, 'Compiler.Builder.Sort') - ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); - - $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') - ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); - - $container->alias(Tags::class, 'Compiler.Builder.Tags') - ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); - - $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') - ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); - - $container->alias(Title::class, 'Compiler.Builder.Title') - ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); - - $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') - ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); - - $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') - ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); - } - - /** - * Get The AccessSwitch Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitch - * @since 3.2.0 - */ - public function getAccessSwitch(Container $container): AccessSwitch - { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); - } - - /** - * Get The Layout Class. - * - * @param Container $container The DI container. - * - * @return Layout - * @since 3.2.0 - */ - public function getLayout(Container $container): Layout - { - return new Layout(); - } - - /** - * Get The LayoutData Class. - * - * @param Container $container The DI container. - * - * @return LayoutData - * @since 3.2.0 - */ - public function getLayoutData(Container $container): LayoutData - { - return new LayoutData(); - } - - /** - * Get The LibraryManager Class. - * - * @param Container $container The DI container. - * - * @return LibraryManager - * @since 3.2.0 - */ - public function getLibraryManager(Container $container): LibraryManager - { - return new LibraryManager(); - } - - /** - * Get The ListFieldClass Class. - * - * @param Container $container The DI container. - * - * @return ListFieldClass - * @since 3.2.0 - */ - public function getListFieldClass(Container $container): ListFieldClass - { - return new ListFieldClass(); - } - - /** - * Get The ListHeadOverride Class. - * - * @param Container $container The DI container. - * - * @return ListHeadOverride - * @since 3.2.0 - */ - public function getListHeadOverride(Container $container): ListHeadOverride - { - return new ListHeadOverride(); - } - - /** - * Get The ListJoin Class. - * - * @param Container $container The DI container. - * - * @return ListJoin - * @since 3.2.0 - */ - public function getListJoin(Container $container): ListJoin - { - return new ListJoin(); - } - - /** - * Get The Lists Class. - * - * @param Container $container The DI container. - * - * @return Lists - * @since 3.2.0 - */ - public function getLists(Container $container): Lists - { - return new Lists(); - } - - /** - * Get The MainTextField Class. - * - * @param Container $container The DI container. - * - * @return MainTextField - * @since 3.2.0 - */ - public function getMainTextField(Container $container): MainTextField - { - return new MainTextField(); - } - - /** - * Get The MetaData Class. - * - * @param Container $container The DI container. - * - * @return MetaData - * @since 3.2.0 - */ - public function getMetaData(Container $container): MetaData - { - return new MetaData(); - } - - /** - * Get The ModelBasicField Class. - * - * @param Container $container The DI container. - * - * @return ModelBasicField - * @since 3.2.0 - */ - public function getModelBasicField(Container $container): ModelBasicField - { - return new ModelBasicField(); - } - - /** - * Get The ModelExpertField Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertField - * @since 3.2.0 - */ - public function getModelExpertField(Container $container): ModelExpertField - { - return new ModelExpertField(); - } - - /** - * Get The ModelExpertFieldInitiator Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertFieldInitiator - * @since 3.2.0 - */ - public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator - { - return new ModelExpertFieldInitiator(); - } - - /** - * Get The ModelMediumField Class. - * - * @param Container $container The DI container. - * - * @return ModelMediumField - * @since 3.2.0 - */ - public function getModelMediumField(Container $container): ModelMediumField - { - return new ModelMediumField(); - } - - /** - * Get The ModelWhmcsField Class. - * - * @param Container $container The DI container. - * - * @return ModelWhmcsField - * @since 3.2.0 - */ - public function getModelWhmcsField(Container $container): ModelWhmcsField - { - return new ModelWhmcsField(); - } - - /** - * Get The MovedPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return MovedPublishingFields - * @since 3.2.0 - */ - public function getMovedPublishingFields(Container $container): MovedPublishingFields - { - return new MovedPublishingFields(); - } - - /** - * Get The MysqlTableSetting Class. - * - * @param Container $container The DI container. - * - * @return MysqlTableSetting - * @since 3.2.0 - */ - public function getMysqlTableSetting(Container $container): MysqlTableSetting - { - return new MysqlTableSetting(); - } - - /** - * Get The NewPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return NewPublishingFields - * @since 3.2.0 - */ - public function getNewPublishingFields(Container $container): NewPublishingFields - { - return new NewPublishingFields(); - } - - /** - * Get The OrderZero Class. - * - * @param Container $container The DI container. - * - * @return OrderZero - * @since 3.2.0 - */ - public function getOrderZero(Container $container): OrderZero - { - return new OrderZero(); - } - - /** - * Get The OtherFilter Class. - * - * @param Container $container The DI container. - * - * @return OtherFilter - * @since 3.2.0 - */ - public function getOtherFilter(Container $container): OtherFilter - { - return new OtherFilter(); - } - - /** - * Get The OtherGroup Class. - * - * @param Container $container The DI container. - * - * @return OtherGroup - * @since 3.2.0 - */ - public function getOtherGroup(Container $container): OtherGroup - { - return new OtherGroup(); - } - - /** - * Get The OtherJoin Class. - * - * @param Container $container The DI container. - * - * @return OtherJoin - * @since 3.2.0 - */ - public function getOtherJoin(Container $container): OtherJoin - { - return new OtherJoin(); - } - - /** - * Get The OtherOrder Class. - * - * @param Container $container The DI container. - * - * @return OtherOrder - * @since 3.2.0 - */ - public function getOtherOrder(Container $container): OtherOrder - { - return new OtherOrder(); - } - - /** - * Get The OtherQuery Class. - * - * @param Container $container The DI container. - * - * @return OtherQuery - * @since 3.2.0 - */ - public function getOtherQuery(Container $container): OtherQuery - { - return new OtherQuery(); - } - - /** - * Get The OtherWhere Class. - * - * @param Container $container The DI container. - * - * @return OtherWhere - * @since 3.2.0 - */ - public function getOtherWhere(Container $container): OtherWhere - { - return new OtherWhere(); - } - - /** - * Get The PermissionAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionAction - * @since 3.2.0 - */ - public function getPermissionAction(Container $container): PermissionAction - { - return new PermissionAction(); - } - - /** - * Get The PermissionComponent Class. - * - * @param Container $container The DI container. - * - * @return PermissionComponent - * @since 3.2.0 - */ - public function getPermissionComponent(Container $container): PermissionComponent - { - return new PermissionComponent(); - } - - /** - * Get The PermissionCore Class. - * - * @param Container $container The DI container. - * - * @return PermissionCore - * @since 3.2.0 - */ - public function getPermissionCore(Container $container): PermissionCore - { - return new PermissionCore(); - } - - /** - * Get The PermissionDashboard Class. - * - * @param Container $container The DI container. - * - * @return PermissionDashboard - * @since 3.2.0 - */ - public function getPermissionDashboard(Container $container): PermissionDashboard - { - return new PermissionDashboard(); - } - - /** - * Get The PermissionGlobalAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionGlobalAction - * @since 3.2.0 - */ - public function getPermissionGlobalAction(Container $container): PermissionGlobalAction - { - return new PermissionGlobalAction(); - } - - /** - * Get The PermissionViews Class. - * - * @param Container $container The DI container. - * - * @return PermissionViews - * @since 3.2.0 - */ - public function getPermissionViews(Container $container): PermissionViews - { - return new PermissionViews(); - } - - /** - * Get The ScriptMediaSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptMediaSwitch - * @since 3.2.0 - */ - public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch - { - return new ScriptMediaSwitch(); - } - - /** - * Get The ScriptUserSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptUserSwitch - * @since 3.2.0 - */ - public function getScriptUserSwitch(Container $container): ScriptUserSwitch - { - return new ScriptUserSwitch(); - } - - /** - * Get The Search Class. - * - * @param Container $container The DI container. - * - * @return Search - * @since 3.2.0 - */ - public function getSearch(Container $container): Search - { - return new Search(); - } - - /** - * Get The SelectionTranslation Class. - * - * @param Container $container The DI container. - * - * @return SelectionTranslation - * @since 3.2.0 - */ - public function getSelectionTranslation(Container $container): SelectionTranslation - { - return new SelectionTranslation(); - } - - /** - * Get The SiteDecrypt Class. - * - * @param Container $container The DI container. - * - * @return SiteDecrypt - * @since 3.2.0 - */ - public function getSiteDecrypt(Container $container): SiteDecrypt - { - return new SiteDecrypt(); - } - - /** - * Get The SiteDynamicGet Class. - * - * @param Container $container The DI container. - * - * @return SiteDynamicGet - * @since 3.2.0 - */ - public function getSiteDynamicGet(Container $container): SiteDynamicGet - { - return new SiteDynamicGet(); - } - - /** - * Get The SiteEditView Class. - * - * @param Container $container The DI container. - * - * @return SiteEditView - * @since 3.2.0 - */ - public function getSiteEditView(Container $container): SiteEditView - { - return new SiteEditView(); - } - - /** - * Get The SiteFieldData Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldData - * @since 3.2.0 - */ - public function getSiteFieldData(Container $container): SiteFieldData - { - return new SiteFieldData(); - } - - /** - * Get The SiteFieldDecodeFilter Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldDecodeFilter - * @since 3.2.0 - */ - public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter - { - return new SiteFieldDecodeFilter(); - } - - /** - * Get The SiteFields Class. - * - * @param Container $container The DI container. - * - * @return SiteFields - * @since 3.2.0 - */ - public function getSiteFields(Container $container): SiteFields - { - return new SiteFields(); - } - - /** - * Get The SiteMainGet Class. - * - * @param Container $container The DI container. - * - * @return SiteMainGet - * @since 3.2.0 - */ - public function getSiteMainGet(Container $container): SiteMainGet - { - return new SiteMainGet(); - } - - /** - * Get The Sort Class. - * - * @param Container $container The DI container. - * - * @return Sort - * @since 3.2.0 - */ - public function getSort(Container $container): Sort - { - return new Sort(); - } - - /** - * Get The TabCounter Class. - * - * @param Container $container The DI container. - * - * @return TabCounter - * @since 3.2.0 - */ - public function getTabCounter(Container $container): TabCounter - { - return new TabCounter(); - } - - /** - * Get The Tags Class. - * - * @param Container $container The DI container. - * - * @return Tags - * @since 3.2.0 - */ - public function getTags(Container $container): Tags - { - return new Tags(); - } - - /** - * Get The TemplateData Class. - * - * @param Container $container The DI container. - * - * @return TemplateData - * @since 3.2.0 - */ - public function getTemplateData(Container $container): TemplateData - { - return new TemplateData(); - } - - /** - * Get The Title Class. - * - * @param Container $container The DI container. - * - * @return Title - * @since 3.2.0 - */ - public function getTitle(Container $container): Title - { - return new Title(); - } - - /** - * Get The UikitComp Class. - * - * @param Container $container The DI container. - * - * @return UikitComp - * @since 3.2.0 - */ - public function getUikitComp(Container $container): UikitComp - { - return new UikitComp(); - } - - /** - * Get The UpdateMysql Class. - * - * @param Container $container The DI container. - * - * @return UpdateMysql - * @since 3.2.0 - */ - public function getUpdateMysql(Container $container): UpdateMysql - { - return new UpdateMysql(); + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); + + $container->alias(Layout::class, 'Compiler.Builder.Layout') + ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); + + $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') + ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); + + $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') + ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); + + $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') + ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); + + $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') + ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); + + $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') + ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); + + $container->alias(Lists::class, 'Compiler.Builder.Lists') + ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); + + $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') + ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); + + $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') + ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); + + $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') + ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); + + $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') + ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); + + $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') + ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); + + $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') + ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); + + $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') + ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); + + $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') + ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); + + $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') + ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); + + $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') + ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); + + $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') + ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); + + $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') + ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); + + $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') + ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); + + $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') + ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); + + $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') + ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); + + $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') + ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); + + $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') + ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); + + $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') + ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); + + $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') + ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); + + $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') + ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); + + $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') + ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') + ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); + + $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') + ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') + ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); + + $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') + ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); + + $container->alias(Search::class, 'Compiler.Builder.Search') + ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); + + $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') + ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); + + $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') + ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); + + $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') + ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); + + $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') + ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); + + $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') + ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); + + $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') + ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); + + $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') + ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); + + $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') + ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); + + $container->alias(Sort::class, 'Compiler.Builder.Sort') + ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); + + $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') + ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); + + $container->alias(Tags::class, 'Compiler.Builder.Tags') + ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); + + $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') + ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); + + $container->alias(Title::class, 'Compiler.Builder.Title') + ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); + + $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') + ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); + + $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') + ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } + + /** + * Get The LanguageMessages Class. + * + * @param Container $container The DI container. + * + * @return LanguageMessages + * @since 3.2.0 + */ + public function getLanguageMessages(Container $container): LanguageMessages + { + return new LanguageMessages(); + } + + /** + * Get The Layout Class. + * + * @param Container $container The DI container. + * + * @return Layout + * @since 3.2.0 + */ + public function getLayout(Container $container): Layout + { + return new Layout(); + } + + /** + * Get The LayoutData Class. + * + * @param Container $container The DI container. + * + * @return LayoutData + * @since 3.2.0 + */ + public function getLayoutData(Container $container): LayoutData + { + return new LayoutData(); + } + + /** + * Get The LibraryManager Class. + * + * @param Container $container The DI container. + * + * @return LibraryManager + * @since 3.2.0 + */ + public function getLibraryManager(Container $container): LibraryManager + { + return new LibraryManager(); + } + + /** + * Get The ListFieldClass Class. + * + * @param Container $container The DI container. + * + * @return ListFieldClass + * @since 3.2.0 + */ + public function getListFieldClass(Container $container): ListFieldClass + { + return new ListFieldClass(); + } + + /** + * Get The ListHeadOverride Class. + * + * @param Container $container The DI container. + * + * @return ListHeadOverride + * @since 3.2.0 + */ + public function getListHeadOverride(Container $container): ListHeadOverride + { + return new ListHeadOverride(); + } + + /** + * Get The ListJoin Class. + * + * @param Container $container The DI container. + * + * @return ListJoin + * @since 3.2.0 + */ + public function getListJoin(Container $container): ListJoin + { + return new ListJoin(); + } + + /** + * Get The Lists Class. + * + * @param Container $container The DI container. + * + * @return Lists + * @since 3.2.0 + */ + public function getLists(Container $container): Lists + { + return new Lists(); + } + + /** + * Get The MainTextField Class. + * + * @param Container $container The DI container. + * + * @return MainTextField + * @since 3.2.0 + */ + public function getMainTextField(Container $container): MainTextField + { + return new MainTextField(); + } + + /** + * Get The MetaData Class. + * + * @param Container $container The DI container. + * + * @return MetaData + * @since 3.2.0 + */ + public function getMetaData(Container $container): MetaData + { + return new MetaData(); + } + + /** + * Get The ModelBasicField Class. + * + * @param Container $container The DI container. + * + * @return ModelBasicField + * @since 3.2.0 + */ + public function getModelBasicField(Container $container): ModelBasicField + { + return new ModelBasicField(); + } + + /** + * Get The ModelExpertField Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertField + * @since 3.2.0 + */ + public function getModelExpertField(Container $container): ModelExpertField + { + return new ModelExpertField(); + } + + /** + * Get The ModelExpertFieldInitiator Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertFieldInitiator + * @since 3.2.0 + */ + public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator + { + return new ModelExpertFieldInitiator(); + } + + /** + * Get The ModelMediumField Class. + * + * @param Container $container The DI container. + * + * @return ModelMediumField + * @since 3.2.0 + */ + public function getModelMediumField(Container $container): ModelMediumField + { + return new ModelMediumField(); + } + + /** + * Get The ModelWhmcsField Class. + * + * @param Container $container The DI container. + * + * @return ModelWhmcsField + * @since 3.2.0 + */ + public function getModelWhmcsField(Container $container): ModelWhmcsField + { + return new ModelWhmcsField(); + } + + /** + * Get The MovedPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return MovedPublishingFields + * @since 3.2.0 + */ + public function getMovedPublishingFields(Container $container): MovedPublishingFields + { + return new MovedPublishingFields(); + } + + /** + * Get The MysqlTableSetting Class. + * + * @param Container $container The DI container. + * + * @return MysqlTableSetting + * @since 3.2.0 + */ + public function getMysqlTableSetting(Container $container): MysqlTableSetting + { + return new MysqlTableSetting(); + } + + /** + * Get The NewPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return NewPublishingFields + * @since 3.2.0 + */ + public function getNewPublishingFields(Container $container): NewPublishingFields + { + return new NewPublishingFields(); + } + + /** + * Get The OrderZero Class. + * + * @param Container $container The DI container. + * + * @return OrderZero + * @since 3.2.0 + */ + public function getOrderZero(Container $container): OrderZero + { + return new OrderZero(); + } + + /** + * Get The OtherFilter Class. + * + * @param Container $container The DI container. + * + * @return OtherFilter + * @since 3.2.0 + */ + public function getOtherFilter(Container $container): OtherFilter + { + return new OtherFilter(); + } + + /** + * Get The OtherGroup Class. + * + * @param Container $container The DI container. + * + * @return OtherGroup + * @since 3.2.0 + */ + public function getOtherGroup(Container $container): OtherGroup + { + return new OtherGroup(); + } + + /** + * Get The OtherJoin Class. + * + * @param Container $container The DI container. + * + * @return OtherJoin + * @since 3.2.0 + */ + public function getOtherJoin(Container $container): OtherJoin + { + return new OtherJoin(); + } + + /** + * Get The OtherOrder Class. + * + * @param Container $container The DI container. + * + * @return OtherOrder + * @since 3.2.0 + */ + public function getOtherOrder(Container $container): OtherOrder + { + return new OtherOrder(); + } + + /** + * Get The OtherQuery Class. + * + * @param Container $container The DI container. + * + * @return OtherQuery + * @since 3.2.0 + */ + public function getOtherQuery(Container $container): OtherQuery + { + return new OtherQuery(); + } + + /** + * Get The OtherWhere Class. + * + * @param Container $container The DI container. + * + * @return OtherWhere + * @since 3.2.0 + */ + public function getOtherWhere(Container $container): OtherWhere + { + return new OtherWhere(); + } + + /** + * Get The PermissionAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionAction + * @since 3.2.0 + */ + public function getPermissionAction(Container $container): PermissionAction + { + return new PermissionAction(); + } + + /** + * Get The PermissionComponent Class. + * + * @param Container $container The DI container. + * + * @return PermissionComponent + * @since 3.2.0 + */ + public function getPermissionComponent(Container $container): PermissionComponent + { + return new PermissionComponent(); + } + + /** + * Get The PermissionCore Class. + * + * @param Container $container The DI container. + * + * @return PermissionCore + * @since 3.2.0 + */ + public function getPermissionCore(Container $container): PermissionCore + { + return new PermissionCore(); + } + + /** + * Get The PermissionDashboard Class. + * + * @param Container $container The DI container. + * + * @return PermissionDashboard + * @since 3.2.0 + */ + public function getPermissionDashboard(Container $container): PermissionDashboard + { + return new PermissionDashboard(); + } + + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + + /** + * Get The PermissionGlobalAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionGlobalAction + * @since 3.2.0 + */ + public function getPermissionGlobalAction(Container $container): PermissionGlobalAction + { + return new PermissionGlobalAction(); + } + + /** + * Get The PermissionViews Class. + * + * @param Container $container The DI container. + * + * @return PermissionViews + * @since 3.2.0 + */ + public function getPermissionViews(Container $container): PermissionViews + { + return new PermissionViews(); + } + + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * Get The ScriptMediaSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptMediaSwitch + * @since 3.2.0 + */ + public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch + { + return new ScriptMediaSwitch(); + } + + /** + * Get The ScriptUserSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptUserSwitch + * @since 3.2.0 + */ + public function getScriptUserSwitch(Container $container): ScriptUserSwitch + { + return new ScriptUserSwitch(); + } + + /** + * Get The Search Class. + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get The SelectionTranslation Class. + * + * @param Container $container The DI container. + * + * @return SelectionTranslation + * @since 3.2.0 + */ + public function getSelectionTranslation(Container $container): SelectionTranslation + { + return new SelectionTranslation(); + } + + /** + * Get The SiteDecrypt Class. + * + * @param Container $container The DI container. + * + * @return SiteDecrypt + * @since 3.2.0 + */ + public function getSiteDecrypt(Container $container): SiteDecrypt + { + return new SiteDecrypt(); + } + + /** + * Get The SiteDynamicGet Class. + * + * @param Container $container The DI container. + * + * @return SiteDynamicGet + * @since 3.2.0 + */ + public function getSiteDynamicGet(Container $container): SiteDynamicGet + { + return new SiteDynamicGet(); + } + + /** + * Get The SiteEditView Class. + * + * @param Container $container The DI container. + * + * @return SiteEditView + * @since 3.2.0 + */ + public function getSiteEditView(Container $container): SiteEditView + { + return new SiteEditView(); + } + + /** + * Get The SiteFieldData Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldData + * @since 3.2.0 + */ + public function getSiteFieldData(Container $container): SiteFieldData + { + return new SiteFieldData(); + } + + /** + * Get The SiteFieldDecodeFilter Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldDecodeFilter + * @since 3.2.0 + */ + public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter + { + return new SiteFieldDecodeFilter(); + } + + /** + * Get The SiteFields Class. + * + * @param Container $container The DI container. + * + * @return SiteFields + * @since 3.2.0 + */ + public function getSiteFields(Container $container): SiteFields + { + return new SiteFields(); + } + + /** + * Get The SiteMainGet Class. + * + * @param Container $container The DI container. + * + * @return SiteMainGet + * @since 3.2.0 + */ + public function getSiteMainGet(Container $container): SiteMainGet + { + return new SiteMainGet(); + } + + /** + * Get The Sort Class. + * + * @param Container $container The DI container. + * + * @return Sort + * @since 3.2.0 + */ + public function getSort(Container $container): Sort + { + return new Sort(); + } + + /** + * Get The TabCounter Class. + * + * @param Container $container The DI container. + * + * @return TabCounter + * @since 3.2.0 + */ + public function getTabCounter(Container $container): TabCounter + { + return new TabCounter(); + } + + /** + * Get The Tags Class. + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags(); + } + + /** + * Get The TemplateData Class. + * + * @param Container $container The DI container. + * + * @return TemplateData + * @since 3.2.0 + */ + public function getTemplateData(Container $container): TemplateData + { + return new TemplateData(); + } + + /** + * Get The Title Class. + * + * @param Container $container The DI container. + * + * @return Title + * @since 3.2.0 + */ + public function getTitle(Container $container): Title + { + return new Title(); + } + + /** + * Get The UikitComp Class. + * + * @param Container $container The DI container. + * + * @return UikitComp + * @since 3.2.0 + */ + public function getUikitComp(Container $container): UikitComp + { + return new UikitComp(); + } + + /** + * Get The UpdateMysql Class. + * + * @param Container $container The DI container. + * + * @return UpdateMysql + * @since 3.2.0 + */ + public function getUpdateMysql(Container $container): UpdateMysql + { + return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } \ No newline at end of file diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json index 86800a5..d27265f 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json @@ -21,352 +21,396 @@ "as": "default" }, "use_selection2": { - "use": "9481caa2-6d04-4598-8320-543a93927243", + "use": "9b5872d6-c1d8-4602-b443-5844d2c950ee", "as": "default" }, "use_selection3": { - "use": "fe87df7f-b65f-4778-8875-6122ab6b025f", + "use": "9481caa2-6d04-4598-8320-543a93927243", "as": "default" }, "use_selection4": { - "use": "b8b474d4-30e3-4b5a-9988-3adb3450998c", + "use": "fe87df7f-b65f-4778-8875-6122ab6b025f", "as": "default" }, "use_selection5": { - "use": "007177eb-d39d-4093-8840-07a38811c502", + "use": "b8b474d4-30e3-4b5a-9988-3adb3450998c", "as": "default" }, "use_selection6": { - "use": "b24f5184-7e7c-448d-9475-ff3f998f70c3", + "use": "007177eb-d39d-4093-8840-07a38811c502", "as": "default" }, "use_selection7": { - "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", + "use": "b24f5184-7e7c-448d-9475-ff3f998f70c3", "as": "default" }, "use_selection8": { - "use": "8561f1f6-96c7-4e54-8869-0132116d57ce", + "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", "as": "default" }, "use_selection9": { - "use": "3230dd65-6590-4043-9bb8-bebd6d8224b2", + "use": "8561f1f6-96c7-4e54-8869-0132116d57ce", "as": "default" }, "use_selection10": { - "use": "5f57ff1a-c196-45b1-a2ac-33766b44fb95", + "use": "3230dd65-6590-4043-9bb8-bebd6d8224b2", "as": "default" }, "use_selection11": { - "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", "as": "default" }, "use_selection12": { - "use": "9d74d613-5ef7-4cf1-9f12-64f0a8e19806", + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", "as": "default" }, "use_selection13": { - "use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a", + "use": "5f57ff1a-c196-45b1-a2ac-33766b44fb95", "as": "default" }, "use_selection14": { - "use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317", + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + }, + "use_selection99": { + "use": "274a78d1-24c2-4486-b560-b86e9ae72872", "as": "default" }, "use_selection15": { - "use": "202f748a-516b-4782-962e-ac9725c3cac4", + "use": "9d74d613-5ef7-4cf1-9f12-64f0a8e19806", "as": "default" }, "use_selection16": { - "use": "9551b683-67b6-4367-bb14-4b016def37e3", + "use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a", "as": "default" }, "use_selection17": { - "use": "0d8db719-39a6-48b4-85a6-2f97e784e588", + "use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317", "as": "default" }, "use_selection18": { - "use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996", + "use": "202f748a-516b-4782-962e-ac9725c3cac4", "as": "default" }, "use_selection19": { - "use": "58b7f907-4195-4ca3-886c-17877be59887", + "use": "9551b683-67b6-4367-bb14-4b016def37e3", "as": "default" }, "use_selection20": { - "use": "ce0899a9-6271-4fc4-800a-697c122bb112", + "use": "0d8db719-39a6-48b4-85a6-2f97e784e588", "as": "default" }, "use_selection21": { - "use": "0d9d3294-0bed-4c44-b1a1-e172f62cafb2", + "use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996", "as": "default" }, "use_selection22": { - "use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076", + "use": "58b7f907-4195-4ca3-886c-17877be59887", "as": "default" }, "use_selection23": { - "use": "e9b6b06b-f600-4f9d-984d-79c70ae7ae92", + "use": "ce0899a9-6271-4fc4-800a-697c122bb112", "as": "default" }, "use_selection24": { - "use": "d5530adf-c809-45a9-87fc-7cecd3d972d8", + "use": "0d9d3294-0bed-4c44-b1a1-e172f62cafb2", "as": "default" }, "use_selection25": { - "use": "961a2a2e-9f95-4b5f-b1c0-62ee783f9c66", + "use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076", "as": "default" }, "use_selection26": { - "use": "a090a472-eb3d-4086-a6d5-4215e1b1851f", + "use": "e9b6b06b-f600-4f9d-984d-79c70ae7ae92", "as": "default" }, "use_selection27": { - "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", "as": "default" }, "use_selection28": { - "use": "dba0776e-e582-4f73-af3e-e7ed17bc34b3", + "use": "d5530adf-c809-45a9-87fc-7cecd3d972d8", "as": "default" }, "use_selection29": { - "use": "8f46f85d-7921-44e9-a40e-dc4f01c5d43a", + "use": "961a2a2e-9f95-4b5f-b1c0-62ee783f9c66", "as": "default" }, "use_selection30": { - "use": "c7b6f0d5-ec47-4166-915c-e78d49b4fb63", + "use": "a090a472-eb3d-4086-a6d5-4215e1b1851f", "as": "default" }, "use_selection31": { - "use": "507ab90f-7d64-4697-9815-d96f5d1d1185", + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", "as": "default" }, "use_selection32": { - "use": "e54965e7-34fd-481e-b40c-4da089afec5a", + "use": "dba0776e-e582-4f73-af3e-e7ed17bc34b3", "as": "default" }, "use_selection33": { - "use": "0b45357f-b077-4337-92f3-65c1e19d36cd", + "use": "207b5ef3-b3bb-45bf-af14-4572e296d761", "as": "default" }, "use_selection34": { - "use": "2cb33994-052e-42dd-adbc-3ea9f932816f", + "use": "8f46f85d-7921-44e9-a40e-dc4f01c5d43a", "as": "default" }, "use_selection35": { - "use": "952423ba-015a-4104-89a4-030695aa4d15", + "use": "c7b6f0d5-ec47-4166-915c-e78d49b4fb63", "as": "default" }, "use_selection36": { - "use": "1f086665-c007-4085-b363-3a118659ff1b", + "use": "507ab90f-7d64-4697-9815-d96f5d1d1185", "as": "default" }, "use_selection37": { - "use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba", + "use": "6992384f-4f29-489f-a52e-286e03f4593b", "as": "default" }, "use_selection38": { - "use": "45652787-9085-4c67-914f-0da25ae62646", + "use": "e54965e7-34fd-481e-b40c-4da089afec5a", "as": "default" }, "use_selection39": { - "use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb", + "use": "0b45357f-b077-4337-92f3-65c1e19d36cd", "as": "default" }, "use_selection40": { - "use": "bb26cf63-69a5-4c43-b2df-43284c9d907d", + "use": "2cb33994-052e-42dd-adbc-3ea9f932816f", "as": "default" }, "use_selection41": { - "use": "a90a2495-9c26-446c-867e-9ee8f42fb6af", + "use": "952423ba-015a-4104-89a4-030695aa4d15", "as": "default" }, "use_selection42": { - "use": "7415fdb4-5719-40b7-b01f-05588e968b47", + "use": "1f086665-c007-4085-b363-3a118659ff1b", "as": "default" }, "use_selection43": { - "use": "e696927b-e8f4-4cfc-9d25-215db4e3c7a8", + "use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba", "as": "default" }, "use_selection44": { - "use": "c8c5d364-d2bf-41c0-8c64-6b6fed1a28b6", + "use": "45652787-9085-4c67-914f-0da25ae62646", "as": "default" }, "use_selection45": { - "use": "7506a35c-fa32-44ab-bd41-363439b20b82", + "use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb", "as": "default" }, "use_selection46": { - "use": "597663e1-1c02-43e8-aea5-f2161e38ac7f", + "use": "bb26cf63-69a5-4c43-b2df-43284c9d907d", "as": "default" }, "use_selection47": { - "use": "4a857023-2d96-4649-9ed5-910d0329854d", + "use": "44efa649-736d-4656-a0ec-e4f1653a6742", "as": "default" }, "use_selection48": { - "use": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d", + "use": "a90a2495-9c26-446c-867e-9ee8f42fb6af", "as": "default" }, "use_selection49": { - "use": "f052eeef-5112-4efe-98c8-8c7db69dc2d1", + "use": "7415fdb4-5719-40b7-b01f-05588e968b47", "as": "default" }, "use_selection50": { - "use": "a5189bfe-6d15-4452-9fa5-e3e57f7fa791", + "use": "e696927b-e8f4-4cfc-9d25-215db4e3c7a8", "as": "default" }, "use_selection51": { - "use": "b8a92303-8543-4d88-a83c-ece300eaba6d", + "use": "c8c5d364-d2bf-41c0-8c64-6b6fed1a28b6", "as": "default" }, "use_selection52": { - "use": "3468b447-a929-4c28-84a1-f2c3a27e3127", + "use": "7506a35c-fa32-44ab-bd41-363439b20b82", "as": "default" }, "use_selection53": { - "use": "b0b26749-5e2c-4b56-8982-48172f2531fa", + "use": "597663e1-1c02-43e8-aea5-f2161e38ac7f", "as": "default" }, "use_selection54": { - "use": "28cac2bb-df04-454f-b4d6-923b573eb94e", + "use": "4a857023-2d96-4649-9ed5-910d0329854d", "as": "default" }, "use_selection55": { - "use": "9cdff2af-bd1b-452f-810e-d034b9720d2a", + "use": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d", "as": "default" }, "use_selection56": { - "use": "9ff6d6cd-afea-4f15-a67b-fd132d386989", + "use": "f052eeef-5112-4efe-98c8-8c7db69dc2d1", "as": "default" }, "use_selection57": { - "use": "0f141480-afe6-41fb-996c-2a4e566a2f0d", + "use": "a5189bfe-6d15-4452-9fa5-e3e57f7fa791", "as": "default" }, "use_selection58": { - "use": "66b7b5f8-60d6-427a-9f8c-84c11a3d6780", + "use": "b8a92303-8543-4d88-a83c-ece300eaba6d", "as": "default" }, "use_selection59": { - "use": "9d1eec29-f304-4b08-a3e7-8b2d6b1f4a1f", + "use": "3468b447-a929-4c28-84a1-f2c3a27e3127", "as": "default" }, "use_selection60": { - "use": "bf92e1c1-3d5e-4e9d-a585-c79e1468df33", + "use": "b0b26749-5e2c-4b56-8982-48172f2531fa", "as": "default" }, "use_selection61": { - "use": "46b02edb-427e-4c26-a5cb-279828eb4433", + "use": "28cac2bb-df04-454f-b4d6-923b573eb94e", "as": "default" }, "use_selection62": { - "use": "3f83fe11-1ef6-4020-bd73-f3bb58cefe3a", + "use": "9cdff2af-bd1b-452f-810e-d034b9720d2a", "as": "default" }, "use_selection63": { - "use": "74595661-236d-4aa1-99f3-358d093000be", + "use": "9ff6d6cd-afea-4f15-a67b-fd132d386989", "as": "default" }, "use_selection64": { - "use": "fd885c23-88dd-440a-9b05-d02a2b2962f9", + "use": "0f141480-afe6-41fb-996c-2a4e566a2f0d", "as": "default" }, "use_selection65": { - "use": "2528f2bb-6ebc-4d55-9a9d-23ef58534c1a", + "use": "66b7b5f8-60d6-427a-9f8c-84c11a3d6780", "as": "default" }, "use_selection66": { - "use": "94f4939f-82cc-4196-802b-1346ce5c7f99", + "use": "9d1eec29-f304-4b08-a3e7-8b2d6b1f4a1f", "as": "default" }, "use_selection67": { - "use": "5e3d856d-8174-4131-b4e9-9328066438e1", + "use": "bf92e1c1-3d5e-4e9d-a585-c79e1468df33", "as": "default" }, "use_selection68": { - "use": "e046b530-47fe-406f-b45a-b5eec8cbb238", + "use": "46b02edb-427e-4c26-a5cb-279828eb4433", "as": "default" }, "use_selection69": { - "use": "a601888d-12b6-427f-94ae-95004206e24e", + "use": "3f83fe11-1ef6-4020-bd73-f3bb58cefe3a", "as": "default" }, "use_selection70": { - "use": "480d11b9-783b-45d5-bce1-b0c2fcaad08a", + "use": "74595661-236d-4aa1-99f3-358d093000be", "as": "default" }, "use_selection71": { - "use": "17bf80af-3609-4f36-a520-be1a339c278b", + "use": "fd885c23-88dd-440a-9b05-d02a2b2962f9", "as": "default" }, "use_selection72": { - "use": "9042fac6-5ca5-4ebe-94fe-cf9b0718ed36", + "use": "2528f2bb-6ebc-4d55-9a9d-23ef58534c1a", "as": "default" }, "use_selection73": { - "use": "2e764839-8ec6-4726-af50-b5678e0714a4", + "use": "94f4939f-82cc-4196-802b-1346ce5c7f99", "as": "default" }, "use_selection74": { - "use": "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e", + "use": "5e3d856d-8174-4131-b4e9-9328066438e1", "as": "default" }, "use_selection75": { - "use": "c0e46033-5ade-4829-88b7-ca160d36a4d1", + "use": "e046b530-47fe-406f-b45a-b5eec8cbb238", "as": "default" }, "use_selection76": { - "use": "ec0682ee-9166-48f8-951b-9b763792c1d1", + "use": "5133a033-1351-43ec-9692-2907d7b9aacd", "as": "default" }, "use_selection77": { - "use": "abdb7d20-a15e-42d8-bd91-7b09514df7f2", + "use": "a601888d-12b6-427f-94ae-95004206e24e", "as": "default" }, "use_selection78": { - "use": "33f5131e-4a5b-414b-95dd-d22227c2666d", + "use": "480d11b9-783b-45d5-bce1-b0c2fcaad08a", "as": "default" }, "use_selection79": { - "use": "d393c946-4481-43fa-b737-449119dd0a63", + "use": "98419ff3-6628-4539-8365-37f88378bced", "as": "default" }, "use_selection80": { - "use": "52de0ac8-bb9d-4a45-bd2a-a44c48c17ffe", + "use": "17bf80af-3609-4f36-a520-be1a339c278b", "as": "default" }, "use_selection81": { - "use": "17fa7789-a7d1-465e-b733-8c8d53f5ca1b", + "use": "9042fac6-5ca5-4ebe-94fe-cf9b0718ed36", "as": "default" }, "use_selection82": { - "use": "94e0beae-7daa-43b2-81b9-0bde390a76d8", + "use": "2e764839-8ec6-4726-af50-b5678e0714a4", "as": "default" }, "use_selection83": { - "use": "d645881c-ae8c-4828-a217-6bad98cd3b44", + "use": "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e", "as": "default" }, "use_selection84": { - "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "use": "c0e46033-5ade-4829-88b7-ca160d36a4d1", "as": "default" }, "use_selection85": { - "use": "8591f6db-dd3c-4a63-9b3f-574c0ec74ade", + "use": "ec0682ee-9166-48f8-951b-9b763792c1d1", "as": "default" }, "use_selection86": { - "use": "6a1dddb3-a955-425e-b713-8ef81f256035", + "use": "abdb7d20-a15e-42d8-bd91-7b09514df7f2", "as": "default" }, "use_selection87": { - "use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d", + "use": "33f5131e-4a5b-414b-95dd-d22227c2666d", "as": "default" }, "use_selection88": { + "use": "d393c946-4481-43fa-b737-449119dd0a63", + "as": "default" + }, + "use_selection89": { + "use": "52de0ac8-bb9d-4a45-bd2a-a44c48c17ffe", + "as": "default" + }, + "use_selection90": { + "use": "17fa7789-a7d1-465e-b733-8c8d53f5ca1b", + "as": "default" + }, + "use_selection91": { + "use": "94e0beae-7daa-43b2-81b9-0bde390a76d8", + "as": "default" + }, + "use_selection92": { + "use": "d645881c-ae8c-4828-a217-6bad98cd3b44", + "as": "default" + }, + "use_selection93": { + "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "as": "default" + }, + "use_selection94": { + "use": "8591f6db-dd3c-4a63-9b3f-574c0ec74ade", + "as": "default" + }, + "use_selection95": { + "use": "6a1dddb3-a955-425e-b713-8ef81f256035", + "as": "default" + }, + "use_selection96": { + "use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d", + "as": "default" + }, + "use_selection97": { "use": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9", "as": "default" + }, + "use_selection98": { + "use": "f34442df-c84c-44c3-9991-bbf72bffa635", + "as": "default" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Builder", diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md index 75e7c51..057d43a 100644 --- a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md @@ -41,7 +41,6 @@ note right of Customcode::__construct ?Extractor $extractor = null ?Power $power = null ?External $external = null - ?\JDatabaseDriver $db = null end note note right of Customcode::update diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php index 54510fd..8474a7f 100644 --- a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php @@ -122,7 +122,6 @@ class Customcode implements CustomcodeInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ protected $db; @@ -140,14 +139,14 @@ class Customcode implements CustomcodeInterface * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, - ?Extractor $extractor = null, ?Power $power = null, ?External $external = null, ?\JDatabaseDriver $db = null) + ?Extractor $extractor = null, ?Power $power = null, ?External $external = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); $this->power = $power ?: Compiler::_('Power.Extractor'); $this->external = $external ?: Compiler::_('Customcode.External'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -423,6 +422,10 @@ class Customcode implements CustomcodeInterface $query->where( $this->db->quoteName('a.target') . ' = 1' ); // <--- to load the correct target + $query->where( + $this->db->quoteName('a.joomla_version') . ' = ' + . (int) $this->config->get('joomla_version', 3) + ); // <--- to load the correct joomla target $query->order( $this->db->quoteName('a.from_line') . ' ASC' ); // <--- insure we always add code from top of file diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.power b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.power index 1a52b55..63fd70c 100644 --- a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.power +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.power @@ -87,7 +87,6 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ protected $db; @@ -105,14 +104,14 @@ * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, - ?Extractor $extractor = null, ?Power $power = null, ?External $external = null, ?\JDatabaseDriver $db = null) + ?Extractor $extractor = null, ?Power $power = null, ?External $external = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); $this->power = $power ?: Compiler::_('Power.Extractor'); $this->external = $external ?: Compiler::_('Customcode.External'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -388,6 +387,10 @@ $query->where( $this->db->quoteName('a.target') . ' = 1' ); // <--- to load the correct target + $query->where( + $this->db->quoteName('a.joomla_version') . ' = ' + . (int) $this->config->get('joomla_version', 3) + ); // <--- to load the correct joomla target $query->order( $this->db->quoteName('a.from_line') . ' ASC' ); // <--- insure we always add code from top of file diff --git a/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/README.md b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/README.md new file mode 100644 index 0000000..3e8909e --- /dev/null +++ b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsGooglechart (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsGooglechart << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # ConfigFieldsets $configfieldsets + # Customfield $customfield + # ExtensionsParams $extensionsparams + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsGooglechart::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + ConfigFieldsets $configfieldsets + Customfield $customfield + ExtensionsParams $extensionsparams +end note + +note right of ConfigFieldsetsGooglechart::set + Set Email Helper Config Fieldsets + + 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/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php new file mode 100644 index 0000000..da6cc16 --- /dev/null +++ b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php @@ -0,0 +1,633 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; + + +/** + * Config Fieldsets Googlechart Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsGooglechart +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + ConfigFieldsets $configfieldsets, + Customfield $customfield, + ExtensionsParams $extensionsparams) + { + $this->config = $config; + $this->language = $language; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + $this->extensionsparams = $extensionsparams; + } + + /** + * Set Email Helper Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->config->get('google_chart', false)) + { + $this->configfieldsets->add('component', PHP_EOL . Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"googlechart_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_CHART_SETTINGS_LABEL\""); + $this->configfieldsets->add('component', Indent::_(2) . "description=\"" . $lang + . "_CHART_SETTINGS_DESC\">"); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartbackground\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#F7F7FA\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_mainwidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add area width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartareatop\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add top spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartarealeft\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add left spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartareawidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add chart width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_legendtextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_legendtextstylefontsize\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add size of the legend here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_vaxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_haxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_haxistitletextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartbackground\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#F7F7FA\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"site_mainwidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add area width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartareatop\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add top spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartarealeft\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add left spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartareawidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add chart width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_legendtextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_legendtextstylefontsize\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add size of the legend here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_vaxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_haxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_haxistitletextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + + // add custom Encryption Settings fields + if ($this->customfield->isArray('Chart Settings')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Chart Settings') + )); + $this->customfield->remove('Chart Settings'); + } + + $this->configfieldsets->add('component', Indent::_(1) . ""); + + // set params defaults + $this->extensionsparams->add('component', + '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"' + ); + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHART_SETTINGS_DESC', + "The Google Chart Display Settings Are Made Here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ADMIN_CHART_NOTE_DESC', + "The following settings are used on the back-end of the site called (admin)." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SITE_CHART_NOTE_DESC', + "The following settings are used on the front-end of the site called (site)." + ); + + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_DESC', + "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_HINT', "170" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_DESC', + "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_HINT', "20" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_LABEL', "Top Spacing" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_DESC', + "Set in % the width of the chart it self inside the chart area. Please don't add the % sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_HINT', "60" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTBACKGROUND_DESC', + "Select the chart background color here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTBACKGROUND_LABEL', + "Chart Background" + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', + "hAxis Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis title's font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', + "hAxis Title Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', + "Select the legend font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', + "Legend Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', + "Set in pixels the font size of the legend" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', + "Legend Font Size" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_DESC', + "Set the width of the entire chart area" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_HINT', "1000" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_LABEL', "Chart Area Width" + ); + $this->language->set( + $this->config->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the vertical axis font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', + "vAxis Font Color" + ); + } + } +} + diff --git a/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.power b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.power new file mode 100644 index 0000000..de10b96 --- /dev/null +++ b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.power @@ -0,0 +1,601 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + ConfigFieldsets $configfieldsets, + Customfield $customfield, + ExtensionsParams $extensionsparams) + { + $this->config = $config; + $this->language = $language; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + $this->extensionsparams = $extensionsparams; + } + + /** + * Set Email Helper Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->config->get('google_chart', false)) + { + $this->configfieldsets->add('component', PHP_EOL . Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"googlechart_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_CHART_SETTINGS_LABEL\""); + $this->configfieldsets->add('component', Indent::_(2) . "description=\"" . $lang + . "_CHART_SETTINGS_DESC\">"); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartbackground\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#F7F7FA\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_mainwidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add area width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartareatop\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add top spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartarealeft\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add left spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_chartareawidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add chart width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_legendtextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_legendtextstylefontsize\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add size of the legend here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_vaxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_haxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"admin_haxistitletextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2)); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartbackground\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#F7F7FA\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"site_mainwidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add area width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartareatop\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add top spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartarealeft\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add left spacing here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_chartareawidth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add chart width here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_legendtextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_legendtextstylefontsize\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"20\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"50\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add size of the legend here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_vaxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_haxistextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"color\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"site_haxistitletextstylefontcolor\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"#63B1F2\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + + // add custom Encryption Settings fields + if ($this->customfield->isArray('Chart Settings')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Chart Settings') + )); + $this->customfield->remove('Chart Settings'); + } + + $this->configfieldsets->add('component', Indent::_(1) . ""); + + // set params defaults + $this->extensionsparams->add('component', + '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"' + ); + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHART_SETTINGS_DESC', + "The Google Chart Display Settings Are Made Here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ADMIN_CHART_NOTE_DESC', + "The following settings are used on the back-end of the site called (admin)." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SITE_CHART_NOTE_DESC', + "The following settings are used on the front-end of the site called (site)." + ); + + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_DESC', + "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_HINT', "170" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_DESC', + "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_HINT', "20" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREATOP_LABEL', "Top Spacing" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_DESC', + "Set in % the width of the chart it self inside the chart area. Please don't add the % sign" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_HINT', "60" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width" + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTBACKGROUND_DESC', + "Select the chart background color here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_CHARTBACKGROUND_LABEL', + "Chart Background" + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', + "hAxis Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis title's font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', + "hAxis Title Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', + "Select the legend font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', + "Legend Font Color" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', + "Set in pixels the font size of the legend" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10" + ); + $this->language->set( + $this->config->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', + "Legend Font Size" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_DESC', + "Set the width of the entire chart area" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_HINT', "1000" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAINWIDTH_LABEL', "Chart Area Width" + ); + $this->language->set( + $this->config->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the vertical axis font color." + ); + $this->language->set( + $this->config->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', + "vAxis Font Color" + ); + } + } \ No newline at end of file diff --git a/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json new file mode 100644 index 0000000..eaff7c5 --- /dev/null +++ b/src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json @@ -0,0 +1,47 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "31c8127c-0d42-4e09-be81-7cf243c5b30f", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsGooglechart", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsGooglechart", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection3": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection4": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsGooglechart", + "description": "Config Fieldsets Googlechart Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php index 6178083..dc4f391 100644 --- a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php @@ -347,6 +347,14 @@ class Structure // check if we should add the dynamic folder moving script to the installer script if (!$this->registry->get('set_move_folders_install_script')) { + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // add the setDynamicF0ld3rs() method to the install script.php file $this->registry->set('set_move_folders_install_script', true); @@ -356,7 +364,9 @@ class Structure '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'), + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED', + $function, $script + ), 'Notice' ); } diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power index 8ba0390..5bc4c02 100644 --- a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power @@ -305,6 +305,14 @@ // check if we should add the dynamic folder moving script to the installer script if (!$this->registry->get('set_move_folders_install_script')) { + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // add the setDynamicF0ld3rs() method to the install script.php file $this->registry->set('set_move_folders_install_script', true); @@ -314,7 +322,9 @@ 'Notice' ); $this->app->enqueueMessage( - Text::sprintf('A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder(s) are copied into the correct place when this component is installed!'), + Text::sprintf('A method (%s) was added to the install %s of this package to insure that the folder(s) are copied into the correct place when this component is installed!', + $function, $script + ), 'Notice' ); } diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md new file mode 100644 index 0000000..37e39bc --- /dev/null +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md @@ -0,0 +1,62 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Header (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Header #Gold { + # $targetVersion + + register(Container $container) : void + + getHeader(Container $container) : HeaderInterface + + getJ3Header(Container $container) : J3Header + + getJ4Header(Container $container) : J4Header +} + +note right of Header::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Header::getHeader + Get the Header + + since: 3.2.0 + return: HeaderInterface +end note + +note right of Header::getJ3Header + Get The Header Class. + + since: 3.2.0 + return: J3Header +end note + +note right of Header::getJ4Header + Get The Header Class. + + since: 3.2.0 + return: J4Header +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php new file mode 100644 index 0000000..d8e3f45 --- /dev/null +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php @@ -0,0 +1,123 @@ + + * @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\HeaderInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header; + + +/** + * Header Service Provider + * + * @since 3.2.0 + */ +class Header 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(J3Header::class, 'J3.Header') + ->share('J3.Header', [$this, 'getJ3Header'], true); + + $container->alias(J4Header::class, 'J4.Header') + ->share('J4.Header', [$this, 'getJ4Header'], true); + + $container->alias(HeaderInterface::class, 'Header') + ->share('Header', [$this, 'getHeader'], true); + } + + /** + * Get the Header + * + * @param Container $container The DI container. + * + * @return HeaderInterface + * @since 3.2.0 + */ + public function getHeader(Container $container): HeaderInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Header'); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J3Header + * @since 3.2.0 + */ + public function getJ3Header(Container $container): J3Header + { + return new J3Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J4Header + * @since 3.2.0 + */ + public function getJ4Header(Container $container): J4Header + { + return new J4Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } +} + diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power new file mode 100644 index 0000000..4e7ad6e --- /dev/null +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power @@ -0,0 +1,93 @@ + /** + * 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(J3Header::class, 'J3.Header') + ->share('J3.Header', [$this, 'getJ3Header'], true); + + $container->alias(J4Header::class, 'J4.Header') + ->share('J4.Header', [$this, 'getJ4Header'], true); + + $container->alias(HeaderInterface::class, 'Header') + ->share('Header', [$this, 'getHeader'], true); + } + + /** + * Get the Header + * + * @param Container $container The DI container. + * + * @return HeaderInterface + * @since 3.2.0 + */ + public function getHeader(Container $container): HeaderInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Header'); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J3Header + * @since 3.2.0 + */ + public function getJ3Header(Container $container): J3Header + { + return new J3Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J4Header + * @since 3.2.0 + */ + public function getJ4Header(Container $container): J4Header + { + return new J4Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } \ No newline at end of file diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json new file mode 100644 index 0000000..bf67321 --- /dev/null +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "36d49d4a-8d0e-435f-ab4c-8f247d96fd4d", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Header", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Header", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "3a777d70-52ad-49ec-9016-6f7438608613", + "as": "default" + }, + "use_selection1": { + "use": "7b56a097-9979-477b-b18a-c9dfc2f1e13b", + "as": "J3Header" + }, + "use_selection2": { + "use": "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49", + "as": "J4Header" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Header", + "description": "Header Service Provider\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/README.md b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/README.md new file mode 100644 index 0000000..af5fd62 --- /dev/null +++ b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AccessSectionsJoomlaFields (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class AccessSectionsJoomlaFields << (F,LightGreen) >> #RoyalBlue { + + get() : string +} + +note right of AccessSectionsJoomlaFields::get + Set Access Sections Joomla Fields + + 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/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php new file mode 100644 index 0000000..c6f7225 --- /dev/null +++ b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Access Sections Joomla Fields Creator Class + * + * @since 3.2.0 + */ +final class AccessSectionsJoomlaFields +{ + /** + * Set Access Sections Joomla Fields + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $component = ''; + // set all the core field permissions + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . '
'; + + return $component; + } +} + diff --git a/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.power b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.power new file mode 100644 index 0000000..dbb80cc --- /dev/null +++ b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.power @@ -0,0 +1,37 @@ + /** + * Set Access Sections Joomla Fields + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $component = ''; + // set all the core field permissions + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(1) . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . '
'; + + return $component; + } \ No newline at end of file diff --git a/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json new file mode 100644 index 0000000..595785f --- /dev/null +++ b/src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json @@ -0,0 +1,23 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "396f9883-4e50-4b65-a1d5-05bd6c23df30", + "implements": null, + "load_selection": null, + "name": "AccessSectionsJoomlaFields", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.AccessSectionsJoomlaFields", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.AccessSectionsJoomlaFields", + "description": "Access Sections Joomla Fields Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php index f0cca17..1f15a35 100644 --- a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php +++ b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php @@ -160,10 +160,10 @@ class Data { // set the Layout data $lay1 = GetHelper::allBetween( - $content, "JLayoutHelper::render('", "'," + $content, "LayoutHelper::render('", "'," ); $lay2 = GetHelper::allBetween( - $content, 'JLayoutHelper::render("', '",' + $content, 'LayoutHelper::render("', '",' ); if (ArrayHelper::check($lay1) && ArrayHelper::check($lay2)) diff --git a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.power b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.power index 281a9d7..cd3f67a 100644 --- a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.power +++ b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.power @@ -131,10 +131,10 @@ { // set the Layout data $lay1 = GetHelper::allBetween( - $content, "JLayoutHelper::render('", "'," + $content, "LayoutHelper::render('", "'," ); $lay2 = GetHelper::allBetween( - $content, 'JLayoutHelper::render("', '",' + $content, 'LayoutHelper::render("', '",' ); if (ArrayHelper::check($lay1) && ArrayHelper::check($lay2)) diff --git a/src/3a777d70-52ad-49ec-9016-6f7438608613/README.md b/src/3a777d70-52ad-49ec-9016-6f7438608613/README.md new file mode 100644 index 0000000..df29108 --- /dev/null +++ b/src/3a777d70-52ad-49ec-9016-6f7438608613/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface HeaderInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface HeaderInterface #Lavender { + + get(string $context, string $codeName) : string +} + +note right of HeaderInterface::get + Get the headers for a file + + 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/3a777d70-52ad-49ec-9016-6f7438608613/code.php b/src/3a777d70-52ad-49ec-9016-6f7438608613/code.php new file mode 100644 index 0000000..0188a0c --- /dev/null +++ b/src/3a777d70-52ad-49ec-9016-6f7438608613/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 Header Interface + * + * @since 3.2.0 + */ +interface HeaderInterface +{ + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string; +} + diff --git a/src/3a777d70-52ad-49ec-9016-6f7438608613/code.power b/src/3a777d70-52ad-49ec-9016-6f7438608613/code.power new file mode 100644 index 0000000..02dc7eb --- /dev/null +++ b/src/3a777d70-52ad-49ec-9016-6f7438608613/code.power @@ -0,0 +1,10 @@ + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string; \ No newline at end of file diff --git a/src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json b/src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json new file mode 100644 index 0000000..7b127e9 --- /dev/null +++ b/src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "3a777d70-52ad-49ec-9016-6f7438608613", + "implements": null, + "load_selection": null, + "name": "HeaderInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.HeaderInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.HeaderInterface", + "description": "Compiler Header Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md index 83f6981..fb6e9b8 100644 --- a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md @@ -25,7 +25,7 @@ class Data #Gold { # Phpcustomview $php # Custombuttons $custombuttons # Ajaxcustomview $ajax - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?EventInterface $event = null, ...) + get(int $id, string $table = 'site_view') : ?object } @@ -49,7 +49,6 @@ note right of Data::__construct ?Phpcustomview $php = null ?Ajaxcustomview $ajax = null ?Custombuttons $custombuttons = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php index 7095816..f3ac657 100644 --- a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php @@ -155,10 +155,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -176,7 +175,6 @@ class Data * @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 */ @@ -184,7 +182,7 @@ class Data ?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) + ?Ajaxcustomview $ajax = null, ?Custombuttons $custombuttons = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -199,7 +197,7 @@ class Data $this->php = $php ?: Compiler::_('Model.Phpcustomview'); $this->ajax = $ajax ?: Compiler::_('Model.Ajaxcustomview'); $this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -222,13 +220,9 @@ class Data $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) + 'jcb_ce_onBeforeQueryCustomViewData', [&$id, &$table, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -246,8 +240,7 @@ class Data // Trigger Event: jcb_ce_onBeforeModelCustomViewData $this->event->trigger( - 'jcb_ce_onBeforeModelCustomViewData', - array(&$component_context, &$item, &$id, &$table) + 'jcb_ce_onBeforeModelCustomViewData', [&$item, &$id, &$table] ); // set GUI mapper @@ -325,8 +318,7 @@ class Data // Trigger Event: jcb_ce_onAfterModelCustomViewData $this->event->trigger( - 'jcb_ce_onAfterModelCustomViewData', - array(&$component_context, &$item) + 'jcb_ce_onAfterModelCustomViewData', [&$item] ); // set the found data diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.power b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.power index a347ac8..97bbe6b 100644 --- a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.power +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.power @@ -113,10 +113,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -134,7 +133,6 @@ * @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 */ @@ -142,7 +140,7 @@ ?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) + ?Ajaxcustomview $ajax = null, ?Custombuttons $custombuttons = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -157,7 +155,7 @@ $this->php = $php ?: Compiler::_('Model.Phpcustomview'); $this->ajax = $ajax ?: Compiler::_('Model.Ajaxcustomview'); $this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -180,13 +178,9 @@ $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) + 'jcb_ce_onBeforeQueryCustomViewData', [&$id, &$table, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -204,8 +198,7 @@ // Trigger Event: jcb_ce_onBeforeModelCustomViewData $this->event->trigger( - 'jcb_ce_onBeforeModelCustomViewData', - array(&$component_context, &$item, &$id, &$table) + 'jcb_ce_onBeforeModelCustomViewData', [&$item, &$id, &$table] ); // set GUI mapper @@ -283,8 +276,7 @@ // Trigger Event: jcb_ce_onAfterModelCustomViewData $this->event->trigger( - 'jcb_ce_onAfterModelCustomViewData', - array(&$component_context, &$item) + 'jcb_ce_onAfterModelCustomViewData', [&$item] ); // set the found data diff --git a/src/425b1107-933d-4436-87ac-63540ec101c5/README.md b/src/425b1107-933d-4436-87ac-63540ec101c5/README.md new file mode 100644 index 0000000..8f5094b --- /dev/null +++ b/src/425b1107-933d-4436-87ac-63540ec101c5/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AllowAdd (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller** +```uml +@startuml +class AllowAdd << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + # Dispenser $dispenser + + __construct(Config $config, Permission $permission, ...) + + get(string $nameSingleCode) : string +} + +note right of AllowAdd::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Permission $permission + Dispenser $dispenser +end note + +note right of AllowAdd::get + Get Allow Add Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/425b1107-933d-4436-87ac-63540ec101c5/code.php b/src/425b1107-933d-4436-87ac-63540ec101c5/code.php new file mode 100644 index 0000000..8e3e478 --- /dev/null +++ b/src/425b1107-933d-4436-87ac-63540ec101c5/code.php @@ -0,0 +1,129 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface; + + +/** + * Controller Allow Add Class for Joomla 4 + * + * @since 3.2.0 + */ +final class AllowAdd implements AllowAddInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + } + + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // prepare custom permission script + $custom_allow = $this->dispenser->get( + 'php_allowadd', $nameSingleCode, '', null, true + ); + + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.access')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Access check."; + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.access') + . "', 'com_" . $this->component . "');"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + + // load custom permission script + $allow[] = $custom_allow; + + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.create')) + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.create') + . "', \$this->option);"; + } + else + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return parent::allowAdd(\$data);"; + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/425b1107-933d-4436-87ac-63540ec101c5/code.power b/src/425b1107-933d-4436-87ac-63540ec101c5/code.power new file mode 100644 index 0000000..375152e --- /dev/null +++ b/src/425b1107-933d-4436-87ac-63540ec101c5/code.power @@ -0,0 +1,98 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + } + + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // prepare custom permission script + $custom_allow = $this->dispenser->get( + 'php_allowadd', $nameSingleCode, '', null, true + ); + + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.access')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Access check."; + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.access') + . "', 'com_" . $this->component . "');"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + + // load custom permission script + $allow[] = $custom_allow; + + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.create')) + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.create') + . "', \$this->option);"; + } + else + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return parent::allowAdd(\$data);"; + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/425b1107-933d-4436-87ac-63540ec101c5/settings.json b/src/425b1107-933d-4436-87ac-63540ec101c5/settings.json new file mode 100644 index 0000000..a6d1d32 --- /dev/null +++ b/src/425b1107-933d-4436-87ac-63540ec101c5/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "425b1107-933d-4436-87ac-63540ec101c5", + "implements": [ + "c9700450-4f44-4455-bc86-6a7660daadee" + ], + "load_selection": null, + "name": "AllowAdd", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J4.Controller.AllowAdd", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection3": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection4": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFour.Controller.AllowAdd", + "description": "Controller Allow Add Class for Joomla 4\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md new file mode 100644 index 0000000..b7e5768 --- /dev/null +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class CoreRule (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour** +```uml +@startuml +class CoreRule #Gold { + # array $rules + # string $path + + __construct() + + get(bool $lowercase = false) : array + - set(string $path) : void +} + +note right of CoreRule::__construct + Constructor + + since: 3.2.0 +end note + +note right of CoreRule::get + Get the Array of Existing Validation Rule Names + + since: 3.2.0 + return: array +end note + +note right of CoreRule::set + Set the rules found in a path + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php new file mode 100644 index 0000000..02ed5aa --- /dev/null +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php @@ -0,0 +1,125 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour; + + +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface; + + +/** + * Core Joomla Field Rules + * + * @since 3.2.0 + */ +class CoreRule implements CoreRuleInterface +{ + /** + * Local Core Joomla Rules + * + * @var array + * @since 3.2.0 + **/ + protected array $rules = []; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->rules === []) + { + $this->set($this->path); + } + + // return rules if found + if ($this->rules !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->rules + ); + } + + return $this->rules; + } + + // return empty array + return []; + } + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } +} + diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.power b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.power new file mode 100644 index 0000000..6d176ce --- /dev/null +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.power @@ -0,0 +1,97 @@ + /** + * Local Core Joomla Rules + * + * @var array + * @since 3.2.0 + **/ + protected array $rules = []; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->rules === []) + { + $this->set($this->path); + } + + // return rules if found + if ($this->rules !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->rules + ); + } + + return $this->rules; + } + + // return empty array + return []; + } + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } \ No newline at end of file diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json new file mode 100644 index 0000000..26f0dfe --- /dev/null +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb", + "implements": [ + "b9f05dc4-d23a-499a-a826-9749b81818ed" + ], + "load_selection": null, + "name": "CoreRule", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J4.CoreRule", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFour.CoreRule", + "description": "Core Joomla Field Rules\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Filesystem\\Folder;", + "composer": "" +} \ No newline at end of file diff --git a/src/44efa649-736d-4656-a0ec-e4f1653a6742/README.md b/src/44efa649-736d-4656-a0ec-e4f1653a6742/README.md new file mode 100644 index 0000000..79683e9 --- /dev/null +++ b/src/44efa649-736d-4656-a0ec-e4f1653a6742/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class LanguageMessages (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class LanguageMessages << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/44efa649-736d-4656-a0ec-e4f1653a6742/code.php b/src/44efa649-736d-4656-a0ec-e4f1653a6742/code.php new file mode 100644 index 0000000..5197ada --- /dev/null +++ b/src/44efa649-736d-4656-a0ec-e4f1653a6742/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\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Language Messages Builder Class + * + * @since 3.2.0 + */ +final class LanguageMessages extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; +} + diff --git a/src/44efa649-736d-4656-a0ec-e4f1653a6742/code.power b/src/44efa649-736d-4656-a0ec-e4f1653a6742/code.power new file mode 100644 index 0000000..941fce3 --- /dev/null +++ b/src/44efa649-736d-4656-a0ec-e4f1653a6742/code.power @@ -0,0 +1,6 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; \ No newline at end of file diff --git a/src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json b/src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json new file mode 100644 index 0000000..4e6a47b --- /dev/null +++ b/src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "44efa649-736d-4656-a0ec-e4f1653a6742", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "LanguageMessages", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.LanguageMessages", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.LanguageMessages", + "description": "Language Messages Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md new file mode 100644 index 0000000..441106f --- /dev/null +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Event (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour** +```uml +@startuml +class Event #Gold { + # $activePlugins + + __construct(?Registry $params = null) + + trigger(string $event, mixed $data = null) : void +} + +note right of Event::__construct + Constructor + + since: 3.2.0 +end note + +note right of Event::trigger + Trigger 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/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php new file mode 100644 index 0000000..5fda6eb --- /dev/null +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php @@ -0,0 +1,99 @@ + + * @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\JoomlaFour; + + +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 = null) + { + // 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/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power new file mode 100644 index 0000000..6a49e3d --- /dev/null +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power @@ -0,0 +1,71 @@ + /** + * 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 = null) + { + // 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); + } + } + } + } \ No newline at end of file diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json new file mode 100644 index 0000000..c6d9b59 --- /dev/null +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "4729c2b0-f12b-4397-8d77-055d38bca98b", + "implements": [ + "20ed72b0-fcac-4344-aee1-8a65e3bf221d" + ], + "load_selection": null, + "name": "Event", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaFour.Event", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFour.Event", + "description": "Compiler Events\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\Registry\\Registry;", + "composer": "" +} \ No newline at end of file diff --git a/src/4ad7020e-39ab-49ba-977b-de6084944502/code.php b/src/4ad7020e-39ab-49ba-977b-de6084944502/code.php index 883d75e..ce42c5a 100644 --- a/src/4ad7020e-39ab-49ba-977b-de6084944502/code.php +++ b/src/4ad7020e-39ab-49ba-977b-de6084944502/code.php @@ -211,6 +211,11 @@ class Fieldset "Another " . $nameSingle . " has the same alias." ); + $this->language->set( + $langTarget, $langView . '_ERROR_UNIQUE_ALIAS_TRASHED', + "A trashed " . $nameSingle + . " has the same alias ." + ); $this->language->set( $langTarget, $langView . '_CREATED_DATE_LABEL', "Created Date" ); diff --git a/src/4ad7020e-39ab-49ba-977b-de6084944502/code.power b/src/4ad7020e-39ab-49ba-977b-de6084944502/code.power index c7df909..f00f882 100644 --- a/src/4ad7020e-39ab-49ba-977b-de6084944502/code.power +++ b/src/4ad7020e-39ab-49ba-977b-de6084944502/code.power @@ -184,6 +184,11 @@ "Another " . $nameSingle . " has the same alias." ); + $this->language->set( + $langTarget, $langView . '_ERROR_UNIQUE_ALIAS_TRASHED', + "A trashed " . $nameSingle + . " has the same alias ." + ); $this->language->set( $langTarget, $langView . '_CREATED_DATE_LABEL', "Created Date" ); diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md index 2abd56d..4f9a1b7 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md @@ -13,7 +13,7 @@ class Event #Gold { # $activePlugins + __construct(?Registry $params = null) - + trigger(string $event, mixed $data) : void + + trigger(string $event, mixed $data = null) : void } note right of Event::__construct diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php index 6dda2dc..c1583f4 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php @@ -71,7 +71,7 @@ class Event implements EventInterface * @throws \Exception * @since 3.2.0 */ - public function trigger(string $event, $data) + public function trigger(string $event, $data = null) { // only execute if plugins were loaded (active) if ($this->activePlugins) diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power index 06deba4..f58ddd4 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power @@ -45,7 +45,7 @@ * @throws \Exception * @since 3.2.0 */ - public function trigger(string $event, $data) + public function trigger(string $event, $data = null) { // only execute if plugins were loaded (active) if ($this->activePlugins) diff --git a/src/5133a033-1351-43ec-9692-2907d7b9aacd/README.md b/src/5133a033-1351-43ec-9692-2907d7b9aacd/README.md new file mode 100644 index 0000000..ac21b5b --- /dev/null +++ b/src/5133a033-1351-43ec-9692-2907d7b9aacd/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class PermissionFields (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class PermissionFields << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5133a033-1351-43ec-9692-2907d7b9aacd/code.php b/src/5133a033-1351-43ec-9692-2907d7b9aacd/code.php new file mode 100644 index 0000000..198ebad --- /dev/null +++ b/src/5133a033-1351-43ec-9692-2907d7b9aacd/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\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Permission Fields Builder Class + * + * @since 3.2.0 + */ +final class PermissionFields extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; +} + diff --git a/src/5133a033-1351-43ec-9692-2907d7b9aacd/code.power b/src/5133a033-1351-43ec-9692-2907d7b9aacd/code.power new file mode 100644 index 0000000..941fce3 --- /dev/null +++ b/src/5133a033-1351-43ec-9692-2907d7b9aacd/code.power @@ -0,0 +1,6 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; \ No newline at end of file diff --git a/src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json b/src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json new file mode 100644 index 0000000..6582e3c --- /dev/null +++ b/src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "5133a033-1351-43ec-9692-2907d7b9aacd", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "PermissionFields", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.PermissionFields", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.PermissionFields", + "description": "Permission Fields Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md index e97a23f..a14122c 100644 --- a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md @@ -14,6 +14,7 @@ class Utilities #Gold { + register(Container $container) : void + getFolder(Container $container) : Folder + getFile(Container $container) : File + + getFileInjector(Container $container) : FileInjector + getCounter(Container $container) : Counter + getPaths(Container $container) : Paths + getFiles(Container $container) : Files @@ -45,56 +46,63 @@ note right of Utilities::getFile return: File end note -note left of Utilities::getCounter +note left of Utilities::getFileInjector + Get The FileInjector Class. + + since: 3.2.0 + return: FileInjector +end note + +note right of Utilities::getCounter Get the Compiler Counter since: 3.2.0 return: Counter end note -note right of Utilities::getPaths +note left of Utilities::getPaths Get the Compiler Paths since: 3.2.0 return: Paths end note -note left of Utilities::getFiles +note right of Utilities::getFiles Get the Compiler Files Bucket since: 3.2.0 return: Files end note -note right of Utilities::getConstantpaths +note left of Utilities::getConstantpaths Get the Constant Paths since: 3.2.0 return: Constantpaths end note -note left of Utilities::getDynamicpath +note right of Utilities::getDynamicpath Get the Compiler Dynamic Path since: 3.2.0 return: Dynamicpath end note -note right of Utilities::getPathfix +note left of Utilities::getPathfix Get the Compiler Path Fixer since: 3.2.0 return: Pathfix end note -note left of Utilities::getStructure +note right of Utilities::getStructure Get the Compiler Structure Dynamic Builder since: 3.2.0 return: Structure end note -note right of Utilities::getXml +note left of Utilities::getXml Get the Compiler Xml Helper since: 3.2.0 diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php index 40d4d36..2f4b56a 100644 --- a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php @@ -17,6 +17,7 @@ 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\FileInjector; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; @@ -50,6 +51,9 @@ class Utilities implements ServiceProviderInterface $container->alias(File::class, 'Utilities.File') ->share('Utilities.File', [$this, 'getFile'], true); + $container->alias(FileInjector::class, 'Utilities.FileInjector') + ->share('Utilities.FileInjector', [$this, 'getFileInjector'], true); + $container->alias(Counter::class, 'Utilities.Counter') ->share('Utilities.Counter', [$this, 'getCounter'], true); @@ -106,6 +110,21 @@ class Utilities implements ServiceProviderInterface ); } + /** + * Get The FileInjector Class. + * + * @param Container $container The DI container. + * + * @return FileInjector + * @since 3.2.0 + */ + public function getFileInjector(Container $container): FileInjector + { + return new FileInjector( + $container->get('Power.Injector') + ); + } + /** * Get the Compiler Counter * @@ -203,6 +222,7 @@ class Utilities implements ServiceProviderInterface public function getStructure(Container $container): Structure { return new Structure( + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Utilities.Paths'), $container->get('Utilities.Counter'), diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.power b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.power index 51364a4..3e6c1c9 100644 --- a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.power +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.power @@ -14,6 +14,9 @@ $container->alias(File::class, 'Utilities.File') ->share('Utilities.File', [$this, 'getFile'], true); + $container->alias(FileInjector::class, 'Utilities.FileInjector') + ->share('Utilities.FileInjector', [$this, 'getFileInjector'], true); + $container->alias(Counter::class, 'Utilities.Counter') ->share('Utilities.Counter', [$this, 'getCounter'], true); @@ -70,6 +73,21 @@ ); } + /** + * Get The FileInjector Class. + * + * @param Container $container The DI container. + * + * @return FileInjector + * @since 3.2.0 + */ + public function getFileInjector(Container $container): FileInjector + { + return new FileInjector( + $container->get('Power.Injector') + ); + } + /** * Get the Compiler Counter * @@ -167,6 +185,7 @@ public function getStructure(Container $container): Structure { return new Structure( + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Utilities.Paths'), $container->get('Utilities.Counter'), diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json index dadd0fb..ee5a0fd 100644 --- a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json @@ -25,34 +25,38 @@ "as": "default" }, "use_selection3": { - "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "use": "23f2ca33-440a-4941-8e9a-4bc67522c0cb", "as": "default" }, "use_selection4": { - "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", "as": "default" }, "use_selection5": { - "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", "as": "default" }, "use_selection6": { - "use": "e0c8c931-52a0-4171-9909-e8769505bb1f", + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", "as": "default" }, "use_selection7": { - "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "use": "e0c8c931-52a0-4171-9909-e8769505bb1f", "as": "default" }, "use_selection8": { - "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", "as": "default" }, "use_selection9": { - "use": "1efdded5-d6c8-452c-8f37-0374483a7b3f", + "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", "as": "default" }, "use_selection10": { + "use": "1efdded5-d6c8-452c-8f37-0374483a7b3f", + "as": "default" + }, + "use_selection11": { "use": "f6ba34a2-0cd7-4dc1-ab67-75e962a5045b", "as": "default" } diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/README.md b/src/55278140-80d5-4168-8241-d64515c4b35e/README.md index 1be5f52..751766b 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/README.md +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/README.md @@ -12,6 +12,7 @@ @startuml class Builders << (F,LightGreen) >> #RoyalBlue { # Config $config + # Power $power # Language $language # Placeholder $placeholder # Layout $layout @@ -58,7 +59,7 @@ class Builders << (F,LightGreen) >> #RoyalBlue { # Filter $filter # ComponentFields $componentfields # CMSApplication $app - + __construct(Config $config, Language $language, ...) + + __construct(Config $config, Power $power, ...) + set(string $langLabel, string $langView, ...) : void } @@ -69,6 +70,7 @@ note right of Builders::__construct arguments: Config $config + Power $power Language $language Placeholder $placeholder Layout $layout diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/code.php b/src/55278140-80d5-4168-8241-d64515c4b35e/code.php index 0169217..ab07969 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/code.php +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/code.php @@ -16,6 +16,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Application\CMSApplication; use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Power; use VDM\Joomla\Componentbuilder\Compiler\Language; use VDM\Joomla\Componentbuilder\Compiler\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout; @@ -82,6 +83,14 @@ final class Builders */ protected Config $config; + /** + * The Power Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + /** * The Language Class. * @@ -454,6 +463,7 @@ final class Builders * Constructor. * * @param Config $config The Config Class. + * @param Power $power The Power Class. * @param Language $language The Language Class. * @param Placeholder $placeholder The Placeholder Class. * @param Layout $layout The Layout Class. @@ -503,7 +513,7 @@ final class Builders * * @since 3.2.0 */ - public function __construct(Config $config, Language $language, + public function __construct(Config $config, Power $power, Language $language, Placeholder $placeholder, Layout $layout, SiteFieldData $sitefielddata, Tags $tags, DatabaseTables $databasetables, @@ -536,6 +546,7 @@ final class Builders ComponentFields $componentfields, ?CMSApplication $app = null) { $this->config = $config; + $this->power = $power; $this->language = $language; $this->placeholder = $placeholder; $this->layout = $layout; @@ -1029,6 +1040,8 @@ final class Builders $this->sitefielddata->set( $nameSingleCode, $name, 'basic_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'basic_encryption'; break; @@ -1039,6 +1052,8 @@ final class Builders $this->sitefielddata->set( $nameSingleCode, $name, 'whmcs_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'whmcs_encryption'; break; @@ -1049,6 +1064,8 @@ final class Builders $this->sitefielddata->set( $nameSingleCode, $name, 'medium_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'medium_encryption'; break; diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/code.power b/src/55278140-80d5-4168-8241-d64515c4b35e/code.power index fd89f7a..72a62bc 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/code.power +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/code.power @@ -6,6 +6,14 @@ */ protected Config $config; + /** + * The Power Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + /** * The Language Class. * @@ -378,6 +386,7 @@ * Constructor. * * @param Config $config The Config Class. + * @param Power $power The Power Class. * @param Language $language The Language Class. * @param Placeholder $placeholder The Placeholder Class. * @param Layout $layout The Layout Class. @@ -427,7 +436,7 @@ * * @since 3.2.0 */ - public function __construct(Config $config, Language $language, + public function __construct(Config $config, Power $power, Language $language, Placeholder $placeholder, Layout $layout, SiteFieldData $sitefielddata, Tags $tags, DatabaseTables $databasetables, @@ -460,6 +469,7 @@ ComponentFields $componentfields, ?CMSApplication $app = null) { $this->config = $config; + $this->power = $power; $this->language = $language; $this->placeholder = $placeholder; $this->layout = $layout; @@ -953,6 +963,8 @@ $this->sitefielddata->set( $nameSingleCode, $name, 'basic_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'basic_encryption'; break; @@ -963,6 +975,8 @@ $this->sitefielddata->set( $nameSingleCode, $name, 'whmcs_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'whmcs_encryption'; break; @@ -973,6 +987,8 @@ $this->sitefielddata->set( $nameSingleCode, $name, 'medium_encryption', $typeName ); + // make sure to load FOF encryption (power) + $this->power->get('99175f6d-dba8-4086-8a65-5c4ec175e61d', 1); // add open close method to field data $field['store'] = 'medium_encryption'; break; diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/settings.json b/src/55278140-80d5-4168-8241-d64515c4b35e/settings.json index 95a7373..7ed84f6 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/settings.json +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/settings.json @@ -15,198 +15,202 @@ "as": "default" }, "use_selection1": { - "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", "as": "default" }, "use_selection2": { - "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", "as": "default" }, "use_selection3": { - "use": "a0f032db-2242-41df-8e4a-5e9e6f88201d", + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", "as": "default" }, "use_selection4": { - "use": "15b4addf-bf6b-4691-9c92-858c7de9c2c1", + "use": "a0f032db-2242-41df-8e4a-5e9e6f88201d", "as": "default" }, "use_selection5": { - "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "use": "15b4addf-bf6b-4691-9c92-858c7de9c2c1", "as": "default" }, "use_selection6": { - "use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996", + "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", "as": "default" }, "use_selection7": { - "use": "ce0899a9-6271-4fc4-800a-697c122bb112", + "use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996", "as": "default" }, "use_selection8": { - "use": "0d8db719-39a6-48b4-85a6-2f97e784e588", + "use": "ce0899a9-6271-4fc4-800a-697c122bb112", "as": "default" }, "use_selection9": { - "use": "58b7f907-4195-4ca3-886c-17877be59887", + "use": "0d8db719-39a6-48b4-85a6-2f97e784e588", "as": "default" }, "use_selection10": { - "use": "597663e1-1c02-43e8-aea5-f2161e38ac7f", + "use": "58b7f907-4195-4ca3-886c-17877be59887", "as": "default" }, "use_selection11": { - "use": "2cb33994-052e-42dd-adbc-3ea9f932816f", + "use": "597663e1-1c02-43e8-aea5-f2161e38ac7f", "as": "default" }, "use_selection12": { - "use": "fe87df7f-b65f-4778-8875-6122ab6b025f", + "use": "2cb33994-052e-42dd-adbc-3ea9f932816f", "as": "default" }, "use_selection13": { - "use": "6a1dddb3-a955-425e-b713-8ef81f256035", + "use": "fe87df7f-b65f-4778-8875-6122ab6b025f", "as": "default" }, "use_selection14": { - "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", + "use": "6a1dddb3-a955-425e-b713-8ef81f256035", "as": "default" }, "use_selection15": { - "use": "4a857023-2d96-4649-9ed5-910d0329854d", + "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", "as": "default" }, "use_selection16": { - "use": "202f748a-516b-4782-962e-ac9725c3cac4", + "use": "4a857023-2d96-4649-9ed5-910d0329854d", "as": "default" }, "use_selection17": { - "use": "a090a472-eb3d-4086-a6d5-4215e1b1851f", + "use": "202f748a-516b-4782-962e-ac9725c3cac4", "as": "default" }, "use_selection18": { - "use": "0b45357f-b077-4337-92f3-65c1e19d36cd", + "use": "a090a472-eb3d-4086-a6d5-4215e1b1851f", "as": "default" }, "use_selection19": { - "use": "952423ba-015a-4104-89a4-030695aa4d15", + "use": "0b45357f-b077-4337-92f3-65c1e19d36cd", "as": "default" }, "use_selection20": { - "use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076", + "use": "952423ba-015a-4104-89a4-030695aa4d15", "as": "default" }, "use_selection21": { - "use": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d", + "use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076", "as": "default" }, "use_selection22": { - "use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a", + "use": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d", "as": "default" }, "use_selection23": { - "use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317", + "use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a", "as": "default" }, "use_selection24": { - "use": "9042fac6-5ca5-4ebe-94fe-cf9b0718ed36", + "use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317", "as": "default" }, "use_selection25": { - "use": "17bf80af-3609-4f36-a520-be1a339c278b", + "use": "9042fac6-5ca5-4ebe-94fe-cf9b0718ed36", "as": "default" }, "use_selection26": { - "use": "007177eb-d39d-4093-8840-07a38811c502", + "use": "17bf80af-3609-4f36-a520-be1a339c278b", "as": "default" }, "use_selection27": { - "use": "b24f5184-7e7c-448d-9475-ff3f998f70c3", + "use": "007177eb-d39d-4093-8840-07a38811c502", "as": "default" }, "use_selection28": { - "use": "8561f1f6-96c7-4e54-8869-0132116d57ce", + "use": "b24f5184-7e7c-448d-9475-ff3f998f70c3", "as": "default" }, "use_selection29": { - "use": "bb26cf63-69a5-4c43-b2df-43284c9d907d", + "use": "8561f1f6-96c7-4e54-8869-0132116d57ce", "as": "default" }, "use_selection30": { - "use": "b8b474d4-30e3-4b5a-9988-3adb3450998c", + "use": "bb26cf63-69a5-4c43-b2df-43284c9d907d", "as": "default" }, "use_selection31": { - "use": "a5189bfe-6d15-4452-9fa5-e3e57f7fa791", + "use": "b8b474d4-30e3-4b5a-9988-3adb3450998c", "as": "default" }, "use_selection32": { - "use": "28cac2bb-df04-454f-b4d6-923b573eb94e", + "use": "a5189bfe-6d15-4452-9fa5-e3e57f7fa791", "as": "default" }, "use_selection33": { - "use": "b0b26749-5e2c-4b56-8982-48172f2531fa", + "use": "28cac2bb-df04-454f-b4d6-923b573eb94e", "as": "default" }, "use_selection34": { - "use": "3468b447-a929-4c28-84a1-f2c3a27e3127", + "use": "b0b26749-5e2c-4b56-8982-48172f2531fa", "as": "default" }, "use_selection35": { - "use": "b8a92303-8543-4d88-a83c-ece300eaba6d", + "use": "3468b447-a929-4c28-84a1-f2c3a27e3127", "as": "default" }, "use_selection36": { - "use": "45652787-9085-4c67-914f-0da25ae62646", + "use": "b8a92303-8543-4d88-a83c-ece300eaba6d", "as": "default" }, "use_selection37": { - "use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba", + "use": "45652787-9085-4c67-914f-0da25ae62646", "as": "default" }, "use_selection38": { - "use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb", + "use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba", "as": "default" }, "use_selection39": { - "use": "1f086665-c007-4085-b363-3a118659ff1b", + "use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb", "as": "default" }, "use_selection40": { - "use": "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e", + "use": "1f086665-c007-4085-b363-3a118659ff1b", "as": "default" }, "use_selection41": { - "use": "9481caa2-6d04-4598-8320-543a93927243", + "use": "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e", "as": "default" }, "use_selection42": { - "use": "94e0beae-7daa-43b2-81b9-0bde390a76d8", + "use": "9481caa2-6d04-4598-8320-543a93927243", "as": "default" }, "use_selection43": { - "use": "2e764839-8ec6-4726-af50-b5678e0714a4", + "use": "94e0beae-7daa-43b2-81b9-0bde390a76d8", "as": "default" }, "use_selection44": { - "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "use": "2e764839-8ec6-4726-af50-b5678e0714a4", "as": "default" }, "use_selection45": { - "use": "3230dd65-6590-4043-9bb8-bebd6d8224b2", + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", "as": "default" }, "use_selection46": { - "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", + "use": "3230dd65-6590-4043-9bb8-bebd6d8224b2", "as": "default" }, "use_selection47": { - "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", "as": "default" }, "use_selection48": { - "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", "as": "default" }, "use_selection49": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection50": { "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", "as": "default" } diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md new file mode 100644 index 0000000..c915c67 --- /dev/null +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class ArchitectureController (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class ArchitectureController #Gold { + # $targetVersion + + register(Container $container) : void + + getAllowAdd(Container $container) : AllowAddInterface + + getJ4ControllerAllowAdd(Container $container) : J4ControllerAllowAdd + + getJ3ControllerAllowAdd(Container $container) : J3ControllerAllowAdd + + getAllowEdit(Container $container) : AllowEditInterface + + getJ4ControllerAllowEdit(Container $container) : J4ControllerAllowEdit + + getJ3ControllerAllowEdit(Container $container) : J3ControllerAllowEdit +} + +note right of ArchitectureController::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of ArchitectureController::getAllowAdd + Get The AllowAddInterface Class. + + since: 3.2.0 + return: AllowAddInterface +end note + +note right of ArchitectureController::getJ4ControllerAllowAdd + Get The AllowAdd Class. + + since: 3.2.0 + return: J4ControllerAllowAdd +end note + +note right of ArchitectureController::getJ3ControllerAllowAdd + Get The AllowAdd Class. + + since: 3.2.0 + return: J3ControllerAllowAdd +end note + +note right of ArchitectureController::getAllowEdit + Get The AllowEditInterface Class. + + since: 3.2.0 + return: AllowEditInterface +end note + +note right of ArchitectureController::getJ4ControllerAllowEdit + Get The AllowEdit Class. + + since: 3.2.0 + return: J4ControllerAllowEdit +end note + +note right of ArchitectureController::getJ3ControllerAllowEdit + Get The AllowEdit Class. + + since: 3.2.0 + return: J3ControllerAllowEdit +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php new file mode 100644 index 0000000..dbe542e --- /dev/null +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/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\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit; + + +/** + * Architecture Controller Service Provider + * + * @since 3.2.0 + */ +class ArchitectureController 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(AllowAddInterface::class, 'Architecture.Controller.AllowAdd') + ->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true); + + $container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd') + ->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true); + + $container->alias(J3ControllerAllowAdd::class, 'Architecture.Controller.J3.AllowAdd') + ->share('Architecture.Controller.J3.AllowAdd', [$this, 'getJ3ControllerAllowAdd'], true); + + $container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit') + ->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true); + + $container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit') + ->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true); + + $container->alias(J3ControllerAllowEdit::class, 'Architecture.Controller.J3.AllowEdit') + ->share('Architecture.Controller.J3.AllowEdit', [$this, 'getJ3ControllerAllowEdit'], true); + } + + /** + * Get The AllowAddInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowAddInterface + * @since 3.2.0 + */ + public function getAllowAdd(Container $container): AllowAddInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd'); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ4ControllerAllowAdd(Container $container): J4ControllerAllowAdd + { + return new J4ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ3ControllerAllowAdd(Container $container): J3ControllerAllowAdd + { + return new J3ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowEditInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowEditInterface + * @since 3.2.0 + */ + public function getAllowEdit(Container $container): AllowEditInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit'); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ4ControllerAllowEdit(Container $container): J4ControllerAllowEdit + { + return new J4ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ3ControllerAllowEdit(Container $container): J3ControllerAllowEdit + { + return new J3ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } +} + diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power new file mode 100644 index 0000000..1e7bf86 --- /dev/null +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power @@ -0,0 +1,144 @@ + /** + * 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(AllowAddInterface::class, 'Architecture.Controller.AllowAdd') + ->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true); + + $container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd') + ->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true); + + $container->alias(J3ControllerAllowAdd::class, 'Architecture.Controller.J3.AllowAdd') + ->share('Architecture.Controller.J3.AllowAdd', [$this, 'getJ3ControllerAllowAdd'], true); + + $container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit') + ->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true); + + $container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit') + ->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true); + + $container->alias(J3ControllerAllowEdit::class, 'Architecture.Controller.J3.AllowEdit') + ->share('Architecture.Controller.J3.AllowEdit', [$this, 'getJ3ControllerAllowEdit'], true); + } + + /** + * Get The AllowAddInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowAddInterface + * @since 3.2.0 + */ + public function getAllowAdd(Container $container): AllowAddInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd'); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ4ControllerAllowAdd(Container $container): J4ControllerAllowAdd + { + return new J4ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ3ControllerAllowAdd(Container $container): J3ControllerAllowAdd + { + return new J3ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowEditInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowEditInterface + * @since 3.2.0 + */ + public function getAllowEdit(Container $container): AllowEditInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit'); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ4ControllerAllowEdit(Container $container): J4ControllerAllowEdit + { + return new J4ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ3ControllerAllowEdit(Container $container): J3ControllerAllowEdit + { + return new J3ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } \ No newline at end of file diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json new file mode 100644 index 0000000..a91afca --- /dev/null +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json @@ -0,0 +1,46 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "ArchitectureController", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.ArchitectureController", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "c9700450-4f44-4455-bc86-6a7660daadee", + "as": "default" + }, + "use_selection1": { + "use": "425b1107-933d-4436-87ac-63540ec101c5", + "as": "J4ControllerAllowAdd" + }, + "use_selection2": { + "use": "f21388dc-5ddc-4970-a3c2-55f075024762", + "as": "J3ControllerAllowAdd" + }, + "use_selection3": { + "use": "992a842f-1ba9-4a5c-b214-042459ffe038", + "as": "default" + }, + "use_selection4": { + "use": "ddf31f4b-96ba-46e7-8100-f48e1cefe533", + "as": "J4ControllerAllowEdit" + }, + "use_selection5": { + "use": "8faaed82-522d-4f78-bd43-0ab3f7c72e5f", + "as": "J3ControllerAllowEdit" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.ArchitectureController", + "description": "Architecture Controller Service Provider\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md b/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md index e8275d6..34f4561 100644 --- a/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md @@ -15,7 +15,7 @@ class Selection #Gold { # Config $config # GetAsLookup $getaslookup # SiteFields $sitefields - # \JDatabaseDriver $db + # $db + __construct(Config $config, GetAsLookup $getaslookup, ...) + get(string $methodKey, string $viewCode, ...) : ?array # name(int $id) : string @@ -30,7 +30,6 @@ note right of Selection::__construct Config $config GetAsLookup $getaslookup SiteFields $sitefields - ?\JDatabaseDriver $db = null end note note right of Selection::get diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php index f2153ec..e118114 100644 --- a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php @@ -65,10 +65,9 @@ class Selection /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -76,17 +75,15 @@ class Selection * @param Config $config The Config Class. * @param GetAsLookup $getaslookup The GetAsLookup Class. * @param SiteFields $sitefields The SiteFields Class. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ - public function __construct(Config $config, GetAsLookup $getaslookup, SiteFields $sitefields, - ?\JDatabaseDriver $db = null) + public function __construct(Config $config, GetAsLookup $getaslookup, SiteFields $sitefields) { $this->config = $config; $this->getaslookup = $getaslookup; $this->sitefields = $sitefields; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power index 8bc3574..92865d3 100644 --- a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power @@ -33,10 +33,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -44,17 +43,15 @@ * @param Config $config The Config Class. * @param GetAsLookup $getaslookup The GetAsLookup Class. * @param SiteFields $sitefields The SiteFields Class. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ - public function __construct(Config $config, GetAsLookup $getaslookup, SiteFields $sitefields, - ?\JDatabaseDriver $db = null) + public function __construct(Config $config, GetAsLookup $getaslookup, SiteFields $sitefields) { $this->config = $config; $this->getaslookup = $getaslookup; $this->sitefields = $sitefields; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/README.md b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/README.md new file mode 100644 index 0000000..1d7183a --- /dev/null +++ b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsEncryption (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsEncryption << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # Component $component + # ConfigFieldsets $configfieldsets + # Customfield $customfield + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsEncryption::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + Component $component + ConfigFieldsets $configfieldsets + Customfield $customfield +end note + +note right of ConfigFieldsetsEncryption::set + Set Encryption Config Fieldsets + + 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/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.php b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.php new file mode 100644 index 0000000..b2be965 --- /dev/null +++ b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/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\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Config Fieldsets Encryption Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsEncryption +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + ConfigFieldsets $configfieldsets, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + } + + /** + * Set Encryption Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + // enable the loading of dynamic field sets + $dynamicAddFields = []; + + // Add encryption if needed + if ($this->config->basic_encryption + || $this->config->whmcs_encryption + || $this->config->medium_encryption + || $this->component->get('add_license') + || $this->customfield->isArray('Encryption Settings')) + { + $dynamicAddFields[] = "Encryption Settings"; + // start building field set for encryption functions + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . 'name="encryption_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_ENCRYPTION_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_ENCRYPTION_DESC">'); + + // set tab lang + if (($this->config->basic_encryption + || $this->config->medium_encryption + || $this->config->whmcs_encryption) + && $this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "License & Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The license & encryption keys are set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "License & Encryption Settings"; + } + elseif (($this->config->basic_encryption + || $this->config->medium_encryption + || $this->config->whmcs_encryption) + && $this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "Update & Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The update & encryption keys are set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "Update & Encryption Settings"; + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', "License Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The license key is set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "License Settings"; + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', "Update Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The update key is set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "Update Settings"; + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The encryption key for the field encryption is set here." + ); + } + + if ($this->config->basic_encryption) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_LABEL', "Basic Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_DESC', + "Set the basic local key here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_NOTE_LABEL', + "Basic Encryption" + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_NOTE_DESC', + "When using the basic encryption please use set a 32 character passphrase.
Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_BASIC_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_BASIC_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + if ($this->config->medium_encryption) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_LABEL', + "Medium Key (Path)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_DESC', + "Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_NOTE_LABEL', + "Medium Encryption" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_NOTE_DESC', + "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" + ); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_MEDIUM_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_MEDIUM_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="160"'); + $this->configfieldsets->add('component', Indent::_(3) . 'filter="PATH"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'hint="/home/user/hiddenfolder123/"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // set some error message if the path does not exist + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_PATH_ERROR', + "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." + ); + } + + if ($this->config->whmcs_encryption + || $this->component->get('add_license')) + { + // set field lang label and description + if ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " License Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the license key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " Update Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the update key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + + // adjust the notice based on license + if ($this->component->get('license_type',0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " License Key" + ); + } + elseif ($this->component->get('license_type',0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " Update Key" + ); + } + else + { + if ($this->config->whmcs_encryption) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " Field Encryption Key" + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') . " Key" + ); + } + } + + // add the description based on global settings + if ($this->config->whmcs_encryption) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->component->get('companyname','') + . ".
When using the " + . $this->component->get('companyname','') + . " field encryption you can never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->component->get('companyname','') . "." + ); + } + + // set the fields + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_WHMCS_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_WHMCS_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + // load the dynamic field sets + foreach ($dynamicAddFields as $dynamicAddField) + { + // add custom Encryption Settings fields + if ($this->customfield->isArray($dynamicAddField)) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get($dynamicAddField) + )); + $this->customfield->remove($dynamicAddField); + } + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } +} + diff --git a/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.power b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.power new file mode 100644 index 0000000..786e5be --- /dev/null +++ b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.power @@ -0,0 +1,383 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + ConfigFieldsets $configfieldsets, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + } + + /** + * Set Encryption Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + // enable the loading of dynamic field sets + $dynamicAddFields = []; + + // Add encryption if needed + if ($this->config->basic_encryption + || $this->config->whmcs_encryption + || $this->config->medium_encryption + || $this->component->get('add_license') + || $this->customfield->isArray('Encryption Settings')) + { + $dynamicAddFields[] = "Encryption Settings"; + // start building field set for encryption functions + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . 'name="encryption_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_ENCRYPTION_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_ENCRYPTION_DESC">'); + + // set tab lang + if (($this->config->basic_encryption + || $this->config->medium_encryption + || $this->config->whmcs_encryption) + && $this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "License & Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The license & encryption keys are set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "License & Encryption Settings"; + } + elseif (($this->config->basic_encryption + || $this->config->medium_encryption + || $this->config->whmcs_encryption) + && $this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "Update & Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The update & encryption keys are set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "Update & Encryption Settings"; + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', "License Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The license key is set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "License Settings"; + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', "Update Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The update key is set here." + ); + // add the next dynamic option + $dynamicAddFields[] = "Update Settings"; + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_LABEL', + "Encryption Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ENCRYPTION_DESC', + "The encryption key for the field encryption is set here." + ); + } + + if ($this->config->basic_encryption) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_LABEL', "Basic Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_DESC', + "Set the basic local key here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_NOTE_LABEL', + "Basic Encryption" + ); + $this->language->set( + $this->config->lang_target, $lang . '_BASIC_KEY_NOTE_DESC', + "When using the basic encryption please use set a 32 character passphrase.
Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_BASIC_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_BASIC_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + if ($this->config->medium_encryption) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_LABEL', + "Medium Key (Path)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_DESC', + "Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_NOTE_LABEL', + "Medium Encryption" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_NOTE_DESC', + "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" + ); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_MEDIUM_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_MEDIUM_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="160"'); + $this->configfieldsets->add('component', Indent::_(3) . 'filter="PATH"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'hint="/home/user/hiddenfolder123/"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // set some error message if the path does not exist + $this->language->set( + $this->config->lang_target, $lang . '_MEDIUM_KEY_PATH_ERROR', + "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." + ); + } + + if ($this->config->whmcs_encryption + || $this->component->get('add_license')) + { + // set field lang label and description + if ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " License Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the license key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + elseif ($this->component->get('add_license') + && $this->component->get('license_type', 0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " Update Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the update key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_LABEL', + $this->component->get('companyname', '') . " Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_DESC', + "Add the key you recieved from " + . $this->component->get('companyname', '') . " here." + ); + } + + // adjust the notice based on license + if ($this->component->get('license_type',0) == 3) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " License Key" + ); + } + elseif ($this->component->get('license_type',0) == 2) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " Update Key" + ); + } + else + { + if ($this->config->whmcs_encryption) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') + . " Field Encryption Key" + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->component->get('companyname','') . " Key" + ); + } + } + + // add the description based on global settings + if ($this->config->whmcs_encryption) + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->component->get('companyname','') + . ".
When using the " + . $this->component->get('companyname','') + . " field encryption you can never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->component->get('companyname','') . "." + ); + } + + // set the fields + $this->configfieldsets->add('component', Indent::_(2) + . ''); + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="text"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_WHMCS_KEY_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_WHMCS_KEY_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'size="60"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default=""'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + // load the dynamic field sets + foreach ($dynamicAddFields as $dynamicAddField) + { + // add custom Encryption Settings fields + if ($this->customfield->isArray($dynamicAddField)) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get($dynamicAddField) + )); + $this->customfield->remove($dynamicAddField); + } + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } \ No newline at end of file diff --git a/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json new file mode 100644 index 0000000..13de8a2 --- /dev/null +++ b/src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json @@ -0,0 +1,43 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsEncryption", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsEncryption", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection4": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsEncryption", + "description": "Config Fieldsets Encryption Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/README.md b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/README.md new file mode 100644 index 0000000..0aecddf --- /dev/null +++ b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface SettingsInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component** +```uml +@startuml +interface SettingsInterface #Lavender { + + exists() : bool + + structure() : object + + multiple() : object + + single() : object + + standardFolder(string $folder) : bool + + standardRootFile(string $file) : bool +} + +note right of SettingsInterface::exists + Check if data set is loaded + + since: 3.2.0 + return: bool +end note + +note right of SettingsInterface::structure + Get Joomla - Folder Structure to Create + + since: 3.2.0 + return: object +end note + +note right of SettingsInterface::multiple + Get Joomla - Move Multiple Structure + + since: 3.2.0 + return: object +end note + +note right of SettingsInterface::single + Get Joomla - Move Single Structure + + since: 3.2.0 + return: object +end note + +note right of SettingsInterface::standardFolder + Check if Folder is a Standard Folder + + since: 3.2.0 + return: bool +end note + +note right of SettingsInterface::standardRootFile + Check if File is a Standard Root File + + 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/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php new file mode 100644 index 0000000..f92ea46 --- /dev/null +++ b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php @@ -0,0 +1,74 @@ + + * @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; + + +/** + * Compiler Component Settings Interface + * + * @since 3.2.0 + */ +interface SettingsInterface +{ + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool; + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object; + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object; + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object; + + /** + * 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; + + /** + * 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; +} + diff --git a/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.power b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.power new file mode 100644 index 0000000..c6a4230 --- /dev/null +++ b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.power @@ -0,0 +1,51 @@ + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool; + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object; + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object; + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object; + + /** + * 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; + + /** + * 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; \ No newline at end of file diff --git a/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json new file mode 100644 index 0000000..69e7b32 --- /dev/null +++ b/src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "implements": null, + "load_selection": null, + "name": "SettingsInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.SettingsInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Component.SettingsInterface", + "description": "Compiler Component Settings Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/600515b1-493f-4448-96fe-018e54e087c8/README.md b/src/600515b1-493f-4448-96fe-018e54e087c8/README.md new file mode 100644 index 0000000..41a1190 --- /dev/null +++ b/src/600515b1-493f-4448-96fe-018e54e087c8/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CanEditStateInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model** +```uml +@startuml +interface CanEditStateInterface #Lavender { + + get(string $nameSingleCode) : string +} + +note right of CanEditStateInterface::get + Get Can Edit State Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/600515b1-493f-4448-96fe-018e54e087c8/code.php b/src/600515b1-493f-4448-96fe-018e54e087c8/code.php new file mode 100644 index 0000000..4f28247 --- /dev/null +++ b/src/600515b1-493f-4448-96fe-018e54e087c8/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\Architecture\Model; + + +/** + * Model Can Edit State Interface + * + * @since 3.2.0 + */ +interface CanEditStateInterface +{ + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string; +} + diff --git a/src/600515b1-493f-4448-96fe-018e54e087c8/code.power b/src/600515b1-493f-4448-96fe-018e54e087c8/code.power new file mode 100644 index 0000000..84b6689 --- /dev/null +++ b/src/600515b1-493f-4448-96fe-018e54e087c8/code.power @@ -0,0 +1,9 @@ + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string; \ No newline at end of file diff --git a/src/600515b1-493f-4448-96fe-018e54e087c8/settings.json b/src/600515b1-493f-4448-96fe-018e54e087c8/settings.json new file mode 100644 index 0000000..d20a9e0 --- /dev/null +++ b/src/600515b1-493f-4448-96fe-018e54e087c8/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "600515b1-493f-4448-96fe-018e54e087c8", + "implements": null, + "load_selection": null, + "name": "CanEditStateInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Architecture.Model.CanEditState", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Architecture.Model.CanEditStateInterface", + "description": "Model Can Edit State Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md index d4464f3..a31f254 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md @@ -15,6 +15,7 @@ class History #Gold { + register(Container $container) : void + getHistory(Container $container) : HistoryInterface + getJ3History(Container $container) : J3History + + getJ4History(Container $container) : J4History } note right of History::register @@ -37,6 +38,13 @@ note right of History::getJ3History since: 3.2.0 return: J3History end note + +note right of History::getJ4History + Get the Joomla 4 History + + since: 3.2.0 + return: J4History +end note @enduml ``` diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php index 7b3a67d..031d3f7 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History; /** @@ -47,6 +48,9 @@ class History implements ServiceProviderInterface $container->alias(J3History::class, 'J3.History') ->share('J3.History', [$this, 'getJ3History'], true); + $container->alias(J4History::class, 'J4.History') + ->share('J4.History', [$this, 'getJ4History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -83,6 +87,20 @@ class History implements ServiceProviderInterface $container->get('Config') ); } - + + /** + * Get the Joomla 4 History + * + * @param Container $container The DI container. + * + * @return J4History + * @since 3.2.0 + */ + public function getJ4History(Container $container): J4History + { + return new J4History( + $container->get('Config') + ); + } } diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power index 510195c..403a290 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power @@ -19,6 +19,9 @@ $container->alias(J3History::class, 'J3.History') ->share('J3.History', [$this, 'getJ3History'], true); + $container->alias(J4History::class, 'J4.History') + ->share('J4.History', [$this, 'getJ4History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -55,3 +58,18 @@ $container->get('Config') ); } + + /** + * Get the Joomla 4 History + * + * @param Container $container The DI container. + * + * @return J4History + * @since 3.2.0 + */ + public function getJ4History(Container $container): J4History + { + return new J4History( + $container->get('Config') + ); + } \ No newline at end of file diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json index 04de9da..773cee2 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json @@ -19,6 +19,10 @@ "use_selection1": { "use": "87db51b9-1126-4c21-858b-53dbd3a68b61", "as": "J3History" + }, + "use_selection2": { + "use": "25c7ca86-6088-4f5f-b9fe-13504779c6ba", + "as": "J4History" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.History", diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md index d86a662..98d4f43 100644 --- a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md @@ -7,7 +7,7 @@ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` # final class Settings (Details) -> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree** ```uml @startuml class Settings << (F,LightGreen) >> #RoyalBlue { diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php index 63b5348..fe56328 100644 --- a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php @@ -9,7 +9,7 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Compiler\Component; +namespace VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree; use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; @@ -24,6 +24,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface; /** @@ -31,7 +32,7 @@ use VDM\Joomla\Utilities\StringHelper; * * @since 3.2.0 */ -final class Settings +final class Settings implements SettingsInterface { /** * The standard folders @@ -285,13 +286,9 @@ final class Settings $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) + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] ); return $version_data; @@ -750,7 +747,6 @@ final class Settings } $this->component->remove('files'); - } - + } } diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.power b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.power index c8f3b7f..517203e 100644 --- a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.power +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.power @@ -250,13 +250,9 @@ $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) + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] ); return $version_data; @@ -715,4 +711,4 @@ } $this->component->remove('files'); - } + } \ No newline at end of file diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json index 602a951..d5856dc 100644 --- a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json @@ -3,11 +3,13 @@ "add_licensing_template": "2", "extends": "0", "guid": "63dabe82-0f4a-4ade-9851-8518ade23de2", - "implements": null, + "implements": [ + "5f44e66a-31d0-45ff-92b3-b7372dc57ae9" + ], "load_selection": null, "name": "Settings", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Component.Settings", + "system_name": "JCB.Compiler.Component.J3.Settings", "type": "final class", "use_selection": { "use_selection0": { @@ -59,7 +61,7 @@ "as": "default" } }, - "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Settings", + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.JoomlaThree.Settings", "description": "Compiler Component (Joomla Version) Settings\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md b/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md index 6887889..b7d1239 100644 --- a/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md @@ -17,6 +17,7 @@ class Structuresingle << (F,LightGreen) >> #RoyalBlue { # string $zipFullPath # Config $config # Registry $registry + # Placeholder $placeholder # Settings $settings # Component $component # Content $content @@ -47,6 +48,7 @@ note right of Structuresingle::__construct arguments: Config $config Registry $registry + Placeholder $placeholder Settings $settings Component $component Content $content diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php index 7f9b33d..3e88c3a 100644 --- a/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php @@ -19,7 +19,8 @@ use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\File; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Registry; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Component; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne as Content; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; @@ -85,7 +86,15 @@ final class Structuresingle protected Registry $registry; /** - * The Settings Class. + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. * * @var Settings * @since 3.2.0 @@ -143,24 +152,27 @@ final class Structuresingle /** * Constructor. * - * @param Config $config The Config Class. - * @param Registry $registry The Registry Class. - * @param Settings $settings The Settings Class. - * @param Component $component The Component Class. - * @param Content $content The ContentOne Class. - * @param Counter $counter The Counter Class. - * @param Paths $paths The Paths Class. - * @param Files $files The Files Class. - * @param CMSApplication|null $app The CMS Application object. + * @param Config $config The Config Class. + * @param Registry $registry The Registry Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Component $component The Component Class. + * @param Content $content The ContentOne Class. + * @param Counter $counter The Counter Class. + * @param Paths $paths The Paths Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 */ - public function __construct(Config $config, Registry $registry, Settings $settings, + public function __construct(Config $config, Registry $registry, + Placeholder $placeholder, Settings $settings, Component $component, Content $content, Counter $counter, Paths $paths, Files $files, ?CMSApplication $app = null) { $this->config = $config; $this->registry = $registry; + $this->placeholder = $placeholder; $this->settings = $settings; $this->component = $component; $this->content = $content; @@ -299,21 +311,24 @@ final class Structuresingle { if ($details->rename === 'new') { - $this->newName = $details->newName; + $newName = $details->newName; } else { - $this->newName = str_replace( + $naam = $details->naam ?? 'error'; + $newName = str_replace( $details->rename, $this->config->component_code_name, - (string) $details->naam + (string) $naam ); } } else { - $this->newName = $details->naam; + $newName = $details->naam ?? 'error'; } + + $this->newName = $this->placeholder->update_($newName); } /** @@ -605,13 +620,24 @@ final class Structuresingle // add the setDynamicF0ld3rs() method to the install scipt.php file $this->registry->set('set_move_folders_install_script', true); + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // 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'), + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED', + $function, $script + ), 'Notice' ); } diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/code.power b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.power index 65c484c..4c30e3e 100644 --- a/src/673954d3-78d3-445a-b99f-4b40d617c882/code.power +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.power @@ -47,7 +47,15 @@ protected Registry $registry; /** - * The Settings Class. + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. * * @var Settings * @since 3.2.0 @@ -105,24 +113,27 @@ /** * Constructor. * - * @param Config $config The Config Class. - * @param Registry $registry The Registry Class. - * @param Settings $settings The Settings Class. - * @param Component $component The Component Class. - * @param Content $content The ContentOne Class. - * @param Counter $counter The Counter Class. - * @param Paths $paths The Paths Class. - * @param Files $files The Files Class. - * @param CMSApplication|null $app The CMS Application object. + * @param Config $config The Config Class. + * @param Registry $registry The Registry Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Component $component The Component Class. + * @param Content $content The ContentOne Class. + * @param Counter $counter The Counter Class. + * @param Paths $paths The Paths Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 */ - public function __construct(Config $config, Registry $registry, Settings $settings, + public function __construct(Config $config, Registry $registry, + Placeholder $placeholder, Settings $settings, Component $component, Content $content, Counter $counter, Paths $paths, Files $files, ?CMSApplication $app = null) { $this->config = $config; $this->registry = $registry; + $this->placeholder = $placeholder; $this->settings = $settings; $this->component = $component; $this->content = $content; @@ -261,21 +272,24 @@ { if ($details->rename === 'new') { - $this->newName = $details->newName; + $newName = $details->newName; } else { - $this->newName = str_replace( + $naam = $details->naam ?? 'error'; + $newName = str_replace( $details->rename, $this->config->component_code_name, - (string) $details->naam + (string) $naam ); } } else { - $this->newName = $details->naam; + $newName = $details->naam ?? 'error'; } + + $this->newName = $this->placeholder->update_($newName); } /** @@ -567,13 +581,24 @@ // add the setDynamicF0ld3rs() method to the install scipt.php file $this->registry->set('set_move_folders_install_script', true); + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // set message that this was done (will still add a tutorial link later) $this->app->enqueueMessage( Text::_('

Dynamic folder(s) were detected.

'), 'Notice' ); + $this->app->enqueueMessage( - Text::sprintf('A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder(s) are copied into the correct place when this component is installed!'), + Text::sprintf('A method (%s) was added to the install %s of this package to insure that the folder(s) are copied into the correct place when this component is installed!', + $function, $script + ), 'Notice' ); } diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json b/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json index c119081..7c6e7f3 100644 --- a/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json @@ -19,34 +19,38 @@ "as": "default" }, "use_selection2": { - "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", "as": "default" }, "use_selection3": { + "use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "as": "Settings" + }, + "use_selection4": { "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", "as": "default" }, - "use_selection4": { + "use_selection5": { "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", "as": "Content" }, - "use_selection5": { + "use_selection6": { "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", "as": "default" }, - "use_selection6": { + "use_selection7": { "use": "6f20369a-8536-4870-a1a3-cda254c939c8", "as": "default" }, - "use_selection7": { + "use_selection8": { "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", "as": "default" }, - "use_selection8": { + "use_selection9": { "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", "as": "default" }, - "use_selection9": { + "use_selection10": { "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", "as": "default" } diff --git a/src/6992384f-4f29-489f-a52e-286e03f4593b/README.md b/src/6992384f-4f29-489f-a52e-286e03f4593b/README.md new file mode 100644 index 0000000..968e4ca --- /dev/null +++ b/src/6992384f-4f29-489f-a52e-286e03f4593b/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class HasMenuGlobal (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class HasMenuGlobal << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6992384f-4f29-489f-a52e-286e03f4593b/code.php b/src/6992384f-4f29-489f-a52e-286e03f4593b/code.php new file mode 100644 index 0000000..56e2590 --- /dev/null +++ b/src/6992384f-4f29-489f-a52e-286e03f4593b/code.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Has Menu Global Builder Class + * + * @since 3.2.0 + */ +final class HasMenuGlobal extends Registry implements Registryinterface +{ +} + diff --git a/src/6992384f-4f29-489f-a52e-286e03f4593b/code.power b/src/6992384f-4f29-489f-a52e-286e03f4593b/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/6992384f-4f29-489f-a52e-286e03f4593b/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json b/src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json new file mode 100644 index 0000000..ec52dc3 --- /dev/null +++ b/src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "6992384f-4f29-489f-a52e-286e03f4593b", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "HasMenuGlobal", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.HasMenuGlobal", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.HasMenuGlobal", + "description": "Has Menu Global Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php index dee9d57..c07ccf9 100644 --- a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php +++ b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php @@ -13,7 +13,7 @@ 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\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; use VDM\Joomla\Utilities\ObjectHelper; diff --git a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json index 0d122d4..cc985ac 100644 --- a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json +++ b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json @@ -15,8 +15,8 @@ "as": "Compiler" }, "use_selection1": { - "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", - "as": "default" + "use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "as": "Settings" }, "use_selection2": { "use": "6f20369a-8536-4870-a1a3-cda254c939c8", diff --git a/src/6d179307-b6e5-4f50-962b-5b6360d0759e/README.md b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/README.md new file mode 100644 index 0000000..32a3b08 --- /dev/null +++ b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AccessSectionsCategory (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class AccessSectionsCategory << (F,LightGreen) >> #RoyalBlue { + # CategoryCode $categorycode + + __construct(CategoryCode $categorycode) + + get(string $nameSingleCode, string $nameListCode) : string +} + +note right of AccessSectionsCategory::__construct + Constructor. + + since: 3.2.0 +end note + +note right of AccessSectionsCategory::get + Get Access Sections Category + + 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/6d179307-b6e5-4f50-962b-5b6360d0759e/code.php b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.php new file mode 100644 index 0000000..2f621a6 --- /dev/null +++ b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/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\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Access Sections Category Creator Class + * + * @since 3.2.0 + */ +final class AccessSectionsCategory +{ + /** + * The CategoryCode Class. + * + * @var CategoryCode + * @since 3.2.0 + */ + protected CategoryCode $categorycode; + + /** + * Constructor. + * + * @param CategoryCode $categorycode The CategoryCode Class. + * + * @since 3.2.0 + */ + public function __construct(CategoryCode $categorycode) + { + $this->categorycode = $categorycode; + } + + /** + * Get Access Sections Category + * + * @param string $nameSingleCode + * @param string $nameListCode + * + * @return string + * @since 3.2.0 + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $component = ''; + // check if view has category + $otherViews = $this->categorycode->getString("{$nameSingleCode}.views"); + if ($otherViews !== null && $otherViews == $nameListCode) + { + $component .= PHP_EOL . Indent::_(1) + . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . "
"; + } + + return $component; + } +} + diff --git a/src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.power b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.power new file mode 100644 index 0000000..d50abb8 --- /dev/null +++ b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.power @@ -0,0 +1,53 @@ + /** + * The CategoryCode Class. + * + * @var CategoryCode + * @since 3.2.0 + */ + protected CategoryCode $categorycode; + + /** + * Constructor. + * + * @param CategoryCode $categorycode The CategoryCode Class. + * + * @since 3.2.0 + */ + public function __construct(CategoryCode $categorycode) + { + $this->categorycode = $categorycode; + } + + /** + * Get Access Sections Category + * + * @param string $nameSingleCode + * @param string $nameListCode + * + * @return string + * @since 3.2.0 + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $component = ''; + // check if view has category + $otherViews = $this->categorycode->getString("{$nameSingleCode}.views"); + if ($otherViews !== null && $otherViews == $nameListCode) + { + $component .= PHP_EOL . Indent::_(1) + . '
'; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(2) + . ''; + $component .= PHP_EOL . Indent::_(1) . "
"; + } + + return $component; + } \ No newline at end of file diff --git a/src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json new file mode 100644 index 0000000..56018e9 --- /dev/null +++ b/src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "6d179307-b6e5-4f50-962b-5b6360d0759e", + "implements": null, + "load_selection": null, + "name": "AccessSectionsCategory", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.AccessSectionsCategory", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "b24f5184-7e7c-448d-9475-ff3f998f70c3", + "as": "default" + }, + "use_selection1": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.AccessSectionsCategory", + "description": "Access Sections Category Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/README.md b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/README.md index 375fbe1..a3ff461 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/README.md +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/README.md @@ -22,10 +22,45 @@ class CustomFieldTypeFile << (F,LightGreen) >> #RoyalBlue { # InputButton $inputbutton # FieldGroupControl $fieldgroupcontrol # ExtensionCustomFields $extensioncustomfields + # Header $header + # CoreField $corefield + # array $fieldmap # CMSApplication $app # array $phpFieldArray + # array $placeholders + # array $data + # string $nameListCode + # string $nameSingleCode + # string $contentsKey + # string $type + # string $baseType + # string $rawType + # bool $customTypeWasSet + # string $extends + __construct(Config $config, Content $content, ...) + set(array $data, string $nameListCode, ...) : void + - setTypeName(array $data) : void + - isFieldBuildable(array $data) : bool + - init(array $data, string $nameListCode, ...) : void + - setContentPlaceholders() : void + - determineJPrefix() : string + - setLocalPlaceholders() : void + - getComComponentName() : string + - getViewName() : string + - getViewsName() : string + - getClassNameExtends() : string + - updatePlaceholderValues() : void + - loadGlobalPlaceholders() : void + - handleOwnCustomField() : void + - handleStandardCustomField() : void + - isButtonOptionSet() : bool + - setButtonOptionErrorMessages() : void + - prepareCustomFieldHeader() : void + - prepareCustomFieldBody() : void + - loadPhpScript(string $scriptType, ?string $default = 'return null;') : ?string + - generateGroupLanguageName() : string + - trackExtensionCustomFields() : void + - isUsedInPluginOrModule() : bool } note right of CustomFieldTypeFile::__construct @@ -45,11 +80,16 @@ note right of CustomFieldTypeFile::__construct InputButton $inputbutton FieldGroupControl $fieldgroupcontrol ExtensionCustomFields $extensioncustomfields + Header $header + CoreField $corefield ?CMSApplication $app = null end note -note right of CustomFieldTypeFile::set - set Custom Field Type File +note left of CustomFieldTypeFile::set + Set Custom Field Type File +This method handles the setting of a custom field type. It checks if the field has already been built, +handles namespace in the custom field type name, sets various placeholders, and loads the global placeholders. +Additionally, it manages the setting of dynamic contents based on the field type and other configurations. since: 3.2.0 return: void @@ -59,6 +99,204 @@ note right of CustomFieldTypeFile::set string $nameListCode string $nameSingleCode end note + +note right of CustomFieldTypeFile::setTypeName + Set the type name of the custom field. +This function checks if there is a namespace in the field type name (indicated by a dot). +If a namespace exists, it extracts and removes the namespace from the type name. + + since: 3.2.0 + return: void +end note + +note left of CustomFieldTypeFile::isFieldBuildable + Checks if the field is eligible to be built. +This method examines the 'custom' attribute of the field data to determine if the field has +already been built or if it is marked as 'prime'. It returns true if the field should be built, +and false otherwise. + + since: 3.2.0 + return: bool +end note + +note right of CustomFieldTypeFile::init + The function to set the class values to the current field being build. + + since: 3.2.0 + return: void + + arguments: + array $data + string $nameListCode + string $nameSingleCode +end note + +note left of CustomFieldTypeFile::setContentPlaceholders + The function to set the default content placeholder. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::determineJPrefix + Determines the J prefix for the field type. +This method extracts the prefix from the field type name if it contains a dot, indicating namespace usage. +If no dot is present, it defaults to 'J'. + + since: 3.2.0 + return: string +end note + +note left of CustomFieldTypeFile::setLocalPlaceholders + Set placeholder options for the custom field. +This method maps various data points to their corresponding placeholders. +It takes custom field data, view codes, and a J prefix, and prepares an associative array +of placeholders and their values. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::getComComponentName + Gets the component name for the custom field. +This method extracts the component name from the custom field data. +If the component name is explicitly set in the custom field data, +it returns that name after ensuring it's a safe string. Otherwise, +it defaults to a name constructed from the component code name in the configuration. + + since: 3.2.0 + return: string +end note + +note left of CustomFieldTypeFile::getViewName + Determines the view name for a custom field. +This method extracts the view name from the custom field data, with a fallback +to a provided single view code name if the view name is not explicitly set in the data. + + since: 3.2.0 + return: string +end note + +note right of CustomFieldTypeFile::getViewsName + Gets the formatted name for the views associated with the custom field. +This method checks if a specific views name is provided in the custom field data. +If it is, it formats and returns this name. If not, it defaults to the provided list view name. + + since: 3.2.0 + return: string +end note + +note left of CustomFieldTypeFile::getClassNameExtends + Gets the class name being extended. +This method is for the new namespace class name in Joomla 4 and above. + + since: 3.2.0 + return: string +end note + +note right of CustomFieldTypeFile::updatePlaceholderValues + Update placeholder values in the field data. +This function iterates over the given replacements and applies them to the placeholders. +It updates both the key and value of each placeholder, ensuring that they are correctly set. + + since: 3.2.0 + return: void +end note + +note left of CustomFieldTypeFile::loadGlobalPlaceholders + Load global placeholders into the placeholders array. +This method iterates over the global placeholders and adds them to the replace array. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::handleOwnCustomField + Handle the setting of a own custom field. +This method manages the building of the custom field type file, the handling of PHP scripts, +and specific operations for certain field types like user fields. + + since: 3.2.0 + return: void +end note + +note left of CustomFieldTypeFile::handleStandardCustomField + Handle the setting of a standard custom field. +This method manages the building of the custom field type file, the handling of PHP scripts, +and specific operations for certain field types like user fields. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::isButtonOptionSet + Checks if the button option is set for the custom field. +This function examines the custom field data to determine if the 'add_button' option +is set and configured to a truthy value. It's used to manage specific behaviors or +display messages related to the button option in custom fields. + + since: 3.2.0 + return: bool +end note + +note left of CustomFieldTypeFile::setButtonOptionErrorMessages + Enqueue error messages related to the dynamic button option in custom fields. +This method adds error messages to the queue when there's an attempt to use the dynamic button +option in custom field types where it's not supported. It's specifically used in the context of 'own custom' +field types. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::prepareCustomFieldHeader + Prepare the header for a custom field file. +This method sets up the necessary imports and configurations for the header section of a custom field. +It handles the dynamic setting of comments and import statements based on the field's extension name. + + since: 3.2.0 + return: void +end note + +note left of CustomFieldTypeFile::prepareCustomFieldBody + Prepare the body for a custom field file. +This method sets up the necessary imports and configurations for the body section of a custom field. +It handles the dynamic setting of php code. + + since: 3.2.0 + return: void +end note + +note right of CustomFieldTypeFile::loadPhpScript + Load and process a PHP script for the custom field. + + since: 3.2.0 + return: ?string +end note + +note left of CustomFieldTypeFile::generateGroupLanguageName + Generate a group language name for the custom field. + + since: 3.2.0 + return: string +end note + +note right of CustomFieldTypeFile::trackExtensionCustomFields + Tracks extension custom fields for plugins or modules. +This method is used to track custom fields when they are utilized in plugins or modules. +If the field is used in a plugin or module, it records this information, potentially to facilitate +actions like copying the field over to other parts of the system. + + since: 3.2.0 + return: void +end note + +note left of CustomFieldTypeFile::isUsedInPluginOrModule + Determines if the field is used in a plugin or module. + + since: 3.2.0 + return: bool +end note @enduml ``` diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php index 6fc8ca3..8aa7dcc 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php @@ -23,11 +23,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Language; use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure; -use VDM\Joomla\Componentbuilder\Compiler\Field\InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton; use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface as Header; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; @@ -129,6 +132,30 @@ final class CustomFieldTypeFile */ protected ExtensionCustomFields $extensioncustomfields; + /** + * The HeaderInterface Class. + * + * @var Header + * @since 3.2.0 + */ + protected Header $header; + + /** + * The CoreFieldInterface Class. + * + * @var CoreField + * @since 3.2.0 + */ + protected CoreField $corefield; + + /** + * The core field mapper. + * + * @var array + * @since 3.2.0 + */ + protected array $fieldmap = []; + /** * Application object. * @@ -138,12 +165,93 @@ final class CustomFieldTypeFile protected CMSApplication $app; /** - * Array of php fields Allowed (16) + * Array of php fields Allowed (15) * * @var array * @since 3.2.0 **/ - protected array $phpFieldArray = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x', 'HEADER']; + protected array $phpFieldArray = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x']; + + /** + * The Local Placeholder Values. + * + * @var array + * @since 3.2.0 + */ + protected array $placeholders = []; + + /** + * The field data values. + * + * @var array + * @since 3.2.0 + */ + protected array $data; + + /** + * The List Code Name value. + * + * @var string + * @since 3.2.0 + */ + protected string $nameListCode; + + /** + * The Single Code Name value. + * + * @var string + * @since 3.2.0 + */ + protected string $nameSingleCode; + + /** + * The contents key value. + * + * @var string + * @since 3.2.0 + */ + protected string $contentsKey; + + /** + * The type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $type; + + /** + * The base type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $baseType; + + /** + * The raw type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $rawType; + + /** + * The switch to check if the custom + * type field value was set. + * + * @var bool + * @since 3.2.0 + */ + protected bool $customTypeWasSet; + + /** + * The extends field value. + * + * @var string + * @since 3.2.0 + */ + protected string $extends; /** * Constructor. @@ -159,6 +267,8 @@ final class CustomFieldTypeFile * @param InputButton $inputbutton The InputButton Class. * @param FieldGroupControl $fieldgroupcontrol The FieldGroupControl Class. * @param ExtensionCustomFields $extensioncustomfields The ExtensionCustomFields Class. + * @param Header $header The HeaderInterface Class. + * @param CoreField $corefield The CoreFieldInterface Class. * @param CMSApplication|null $app The app object. * * @since 3.2.0 @@ -170,7 +280,7 @@ final class CustomFieldTypeFile Structure $structure, InputButton $inputbutton, FieldGroupControl $fieldgroupcontrol, ExtensionCustomFields $extensioncustomfields, - ?CMSApplication $app = null) + Header $header, CoreField $corefield, ?CMSApplication $app = null) { $this->config = $config; $this->content = $content; @@ -183,11 +293,17 @@ final class CustomFieldTypeFile $this->inputbutton = $inputbutton; $this->fieldgroupcontrol = $fieldgroupcontrol; $this->extensioncustomfields = $extensioncustomfields; + $this->header = $header; + $this->corefield = $corefield; $this->app = $app ?: Factory::getApplication(); } /** - * set Custom Field Type File + * Set Custom Field Type File + * + * This method handles the setting of a custom field type. It checks if the field has already been built, + * handles namespace in the custom field type name, sets various placeholders, and loads the global placeholders. + * Additionally, it manages the setting of dynamic contents based on the field type and other configurations. * * @param array $data The field complete data set * @param string $nameListCode The list view code name @@ -198,335 +314,679 @@ final class CustomFieldTypeFile */ public function set(array $data, string $nameListCode, string $nameSingleCode): void { - // make sure it is not already been build or if it is prime - if (isset($data['custom']) && isset($data['custom']['extends']) - && ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) - || !$this->contents->isArray('customfield_' . $data['type'])) - ) + $this->setTypeName($data); + + if (!$this->isFieldBuildable($data)) { - // set J prefix - $jprefix = 'J'; - // check if this field has a dot in field type name - if (strpos((string) $data['type'], '.') !== false) + return; + } + + $this->init($data, $nameSingleCode, $nameListCode); + + if (isset($data['custom']['own_custom'])) + { + $this->handleOwnCustomField(); + } + else + { + $this->handleStandardCustomField(); + } + + // Extension custom fields tracking for plugins or modules + $this->trackExtensionCustomFields(); + } + + /** + * Set the type name of the custom field. + * + * This function checks if there is a namespace in the field type name (indicated by a dot). + * If a namespace exists, it extracts and removes the namespace from the type name. + * + * @param array $data The field data which contains the type name. + * + * @return void + * @since 3.2.0 + */ + private function setTypeName(array $data): void + { + $type_name = $this->rawType = $data['type'] ?? ''; + + $this->customTypeWasSet = isset($data['custom']['type']); + + // Check if the field type name contains a dot, indicating a namespace + if (strpos($type_name, '.') !== false) + { + $dot_type_array = explode('.', $type_name); + + // If there are more than one parts, remove the first part (namespace) + if (count($dot_type_array) > 1) { - // so we have name spacing in custom field type name - $dotTypeArray = explode('.', (string) $data['type']); - // set the J prefix - if (count((array) $dotTypeArray) > 1) - { - $jprefix = strtoupper(array_shift($dotTypeArray)); - } - // update the type name now - $data['type'] = implode('', $dotTypeArray); - $data['custom']['type'] = $data['type']; + array_shift($dot_type_array); // Remove the namespace part } - // set the contents key - $contents_key = "customfield_{$data['type']}|"; + + // Update the type name by concatenating the remaining parts + $type_name = implode('', $dot_type_array); + $data['custom']['type'] = ClassfunctionHelper::safe($type_name); + } + + $base_type = $data['custom']['type'] ?? $type_name; + + $this->baseType = ClassfunctionHelper::safe($base_type); + $this->type = ClassfunctionHelper::safe($type_name); + } + + /** + * Checks if the field is eligible to be built. + * + * This method examines the 'custom' attribute of the field data to determine if the field has + * already been built or if it is marked as 'prime'. It returns true if the field should be built, + * and false otherwise. + * + * @param array $data The field data. + * + * @return bool True if the field is buildable, false otherwise. + * @since 3.2.0 + */ + private function isFieldBuildable(array $data): bool + { + // Check if 'custom' key is set in the data. + if (!isset($data['custom'])) + { + return false; + } + + // Check if 'extends' key is set under 'custom'. + if (!isset($data['custom']['extends'])) + { + return false; + } + + // Check if the field is marked as 'prime' or if it hasn't been built yet. + $isPrime = isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1; + $notBuilt = !$this->contents->isArray('customfield_' . $this->type); + + return $isPrime || $notBuilt; + } + + /** + * The function to set the class values to the current field being build. + * + * @param array $data The field complete data set + * @param string $nameListCode The list view code name + * @param string $nameSingleCode The single view code name + * + * @return void + * @since 3.2.0 + */ + private function init(array $data, string $nameListCode, string $nameSingleCode): void + { + $this->data = $data; + $this->nameListCode = $nameListCode; + $this->nameSingleCode = $nameSingleCode; + $this->contentsKey = "customfield_{$this->baseType}|"; + + $this->jprefix = $this->determineJPrefix(); + $this->extends = ClassfunctionHelper::safe($data['custom']['extends']); + + $this->setLocalPlaceholders(); + $this->setContentPlaceholders(); + } + + /** + * The function to set the default content placeholder. + * + * @return void + * @since 3.2.0 + */ + private function setContentPlaceholders(): void + { + $contents_key = $this->contentsKey; + + // Start loading the field type + $this->contents->set("{$contents_key}JPREFIX", $this->jprefix); + + $this->contents->set("{$contents_key}JFORM_extends", $this->extends); + $this->contents->set("{$contents_key}JFORM_EXTENDS", + StringHelper::safe($this->extends, 'F') + ); + + // if own custom field + if (isset($this->data['custom']['own_custom'])) + { + $this->contents->set("{$contents_key}FORM_EXTENDS", + $this->getClassNameExtends() + ); + } + + $this->contents->set("{$contents_key}type", $this->baseType); + $this->contents->set("{$contents_key}Type", + StringHelper::safe($this->baseType, 'F') + ); + } + + /** + * Determines the J prefix for the field type. + * + * This method extracts the prefix from the field type name if it contains a dot, indicating namespace usage. + * If no dot is present, it defaults to 'J'. + * + * @return string The determined J prefix. + * @since 3.2.0 + */ + private function determineJPrefix(): string + { + // Default prefix + $jprefix = 'J'; + + // Check if the field type name contains a dot, indicating namespace usage + if (strpos($this->rawType, '.') !== false) + { + // Explode the type by dot to get the namespace parts + $dot_type_array = explode('.', $this->rawType); + + // If there are multiple parts, use the first part as the prefix + if (count($dot_type_array) > 1) + { + $jprefix = strtoupper(array_shift($dot_type_array)); + } + } + + return $jprefix; + } + + /** + * Set placeholder options for the custom field. + * + * This method maps various data points to their corresponding placeholders. + * It takes custom field data, view codes, and a J prefix, and prepares an associative array + * of placeholders and their values. + * + * @return void + * @since 3.2.0 + */ + private function setLocalPlaceholders(): void + { + // The data set for the custom field + $data = $this->data; + + // Initialize the array for placeholder options + $placeholders = []; + + // Populate the array with specific placeholder options + $placeholders[Placefix::_('JPREFIX')] = $this->jprefix; + + $placeholders[Placefix::_('JFORM_extends')] = $this->extends; + $placeholders[Placefix::_('JFORM_EXTENDS')] = StringHelper::safe($this->extends, 'F'); + + // if own custom field + if (isset($data['custom']['own_custom'])) + { + $placeholders[Placefix::_('FORM_EXTENDS')] = $this->getClassNameExtends(); + } + + $placeholders[Placefix::_('TABLE')] = $data['custom']['table'] ?? ''; + $placeholders[Placefix::_('ID')] = $data['custom']['id'] ?? ''; + $placeholders[Placefix::_('TEXT')] = $data['custom']['text'] ?? ''; + $placeholders[Placefix::_('CODE_TEXT')] = + isset($data['code'], $data['custom']['text']) ? $data['code'] . '_' . $data['custom']['text'] : ''; + $placeholders[Placefix::_('CODE')] = $data['code'] ?? ''; + + $placeholders[Placefix::_('com_component')] = $this->getComComponentName(); + $placeholders[Placefix::_('component')] = $this->config->component_code_name; + $placeholders[Placefix::_('Component')] = $this->content->get('Component'); + + $placeholders[Placefix::_('type')] = $this->baseType; + $placeholders[Placefix::_('Type')] = StringHelper::safe($this->baseType, 'F'); + + $placeholders[Placefix::_('view_type')] = $this->getViewName() . '_' . $this->baseType; + $placeholders[Placefix::_('view')] = $this->getViewName(); + $placeholders[Placefix::_('views')] = $this->getViewsName(); + + // Gymnastics to help with transition to Joomla 4 + if ($this->config->get('joomla_version', 3) == 4) + { + $placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()'; + $placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()'; + $placeholders['JFactory::'] = 'Factory::'; + $placeholders['JHtml::'] = 'Html::'; + $placeholders['JText::'] = 'Text::'; + $placeholders['JComponentHelper::'] = 'ComponentHelper::'; + } + + $this->placeholders = $placeholders; + + $this->updatePlaceholderValues(); + $this->loadGlobalPlaceholders(); + } + + /** + * Gets the component name for the custom field. + * + * This method extracts the component name from the custom field data. + * If the component name is explicitly set in the custom field data, + * it returns that name after ensuring it's a safe string. Otherwise, + * it defaults to a name constructed from the component code name in the configuration. + * + * @return string The name of the component. + * @since 3.2.0 + */ + private function getComComponentName(): string + { + // Check if the component name is explicitly set in the custom field data + if (isset($this->data['custom']['component']) && StringHelper::check($this->data['custom']['component'])) + { + // Return the safe version of the component name + return StringHelper::safe($this->data['custom']['component']); + } + + // Default to a component name constructed from the component code name in the configuration + return 'com_' . $this->config->component_code_name; + } + + /** + * Determines the view name for a custom field. + * + * This method extracts the view name from the custom field data, with a fallback + * to a provided single view code name if the view name is not explicitly set in the data. + * + * @return string The determined view name. + * @since 3.2.0 + */ + private function getViewName(): string + { + // Check if a specific view name is set in the custom field data + if (isset($this->data['custom']['view']) && StringHelper::check($this->data['custom']['view'])) + { + // If a specific view name is set, use it after sanitizing + return StringHelper::safe($this->data['custom']['view']); + } + + // If no specific view name is set, use the single view code name as a fallback + return $this->nameSingleCode; + } + + /** + * Gets the formatted name for the views associated with the custom field. + * + * This method checks if a specific views name is provided in the custom field data. + * If it is, it formats and returns this name. If not, it defaults to the provided list view name. + * + * @return string The formatted name for the views. + * @since 3.2.0 + */ + private function getViewsName(): string + { + // Check if specific views name is provided in the custom field data + if (isset($this->data['custom']['views']) && StringHelper::check($this->data['custom']['views'])) + { + // If yes, use the provided name after ensuring it is properly formatted + return StringHelper::safe($this->data['custom']['views']); + } + + // If no specific name is provided, default to the provided list view name + return $this->nameListCode; + } + + /** + * Gets the class name being extended. + * + * This method is for the new namespace class name in Joomla 4 and above. + * + * @return string The class being name extended. + * @since 3.2.0 + */ + private function getClassNameExtends(): string + { + if (isset($this->fieldmap[$this->extends])) + { + return $this->fieldmap[$this->extends]; + } + + $core_fields = $this->corefield->get(); + $extends = $this->extends; + + foreach ($core_fields as $core_field) + { + $field = strtolower((string) $core_field); + if ($extends === $field) + { + $this->fieldmap[$extends] = $core_field; + + return $core_field; + } + } + + $this->fieldmap[$extends] = StringHelper::safe($extends, 'F'); + + return $this->fieldmap[$extends]; + } + + /** + * Update placeholder values in the field data. + * + * This function iterates over the given replacements and applies them to the placeholders. + * It updates both the key and value of each placeholder, ensuring that they are correctly set. + * + * @return void + * @since 3.2.0 + */ + private function updatePlaceholderValues(): void + { + foreach ($this->placeholders as $placeholder => $value) + { + // Update the key by replacing the placeholders for before and after + $updatedPlaceholder = str_replace( + [Placefix::b(), Placefix::d()], + [Placefix::h(), Placefix::h()], + $placeholder + ); + + // Update the value in the replacements array + $this->placeholders[$updatedPlaceholder] = $value; + } + } + + /** + * Load global placeholders into the placeholders array. + * + * This method iterates over the global placeholders and adds them to the replace array. + * + * @return void + * @since 3.2.0 + */ + private function loadGlobalPlaceholders(): void + { + foreach ($this->componentplaceholder->get() as $globalPlaceholder => $globalValue) + { + $this->placeholders[$globalPlaceholder] = $globalValue; + } + } + + /** + * Handle the setting of a own custom field. + * + * This method manages the building of the custom field type file, the handling of PHP scripts, + * and specific operations for certain field types like user fields. + * + * @return void + * @since 3.2.0 + */ + private function handleOwnCustomField(): void + { + if ($this->isButtonOptionSet()) + { + $this->setButtonOptionErrorMessages(); + } + + $target = ['admin' => 'customfield']; + $this->structure->build($target, 'fieldcustom', $this->baseType); + + $this->prepareCustomFieldHeader(); + $this->prepareCustomFieldBody(); + } + + /** + * Handle the setting of a standard custom field. + * + * This method manages the building of the custom field type file, the handling of PHP scripts, + * and specific operations for certain field types like user fields. + * + * @return void + * @since 3.2.0 + */ + private function handleStandardCustomField(): void + { + // The key used for setting contents. + $contents_key = $this->contentsKey; + + // Build the custom field type file + $target = ['admin' => 'customfield']; + $this->structure->build( + $target, 'field' . $this->extends, $this->baseType + ); + + $php_code = $this->loadPhpScript('php'); + + if ($this->extends === 'user') + { + $this->fieldgroupcontrol->set( + $this->type, $this->generateGroupLanguageName() + ); + + $phpx_code = $this->loadPhpScript('phpx'); + + $this->contents->set("{$contents_key}JFORM_GETGROUPS_PHP", $php_code); + $this->contents->set("{$contents_key}JFORM_GETEXCLUDED_PHP", $phpx_code); + } + else + { + $this->contents->set("{$contents_key}JFORM_GETOPTIONS_PHP", $php_code); + } + + $this->contents->set("{$contents_key}ADD_BUTTON", $this->inputbutton->get($this->data['custom'])); + } + + /** + * Checks if the button option is set for the custom field. + * + * This function examines the custom field data to determine if the 'add_button' option + * is set and configured to a truthy value. It's used to manage specific behaviors or + * display messages related to the button option in custom fields. + * + * @return bool Returns true if the button option is set and true, otherwise false. + * @since 3.2.0 + */ + private function isButtonOptionSet(): bool + { + // Check if 'own_custom' field is set and if 'add_button' option is available and truthy + if (isset($this->data['custom']['own_custom'], $this->data['custom']['add_button'])) + { + $addButton = $this->data['custom']['add_button']; + return $addButton === 'true' || $addButton === 1; + } + + return false; + } + + /** + * Enqueue error messages related to the dynamic button option in custom fields. + * + * This method adds error messages to the queue when there's an attempt to use the dynamic button + * option in custom field types where it's not supported. It's specifically used in the context of 'own custom' + * field types. + * + * @return void + * @since 3.2.0 + */ + private function setButtonOptionErrorMessages(): void + { + $headerMessage = '

' . Text::_('COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR') . '

'; + $detailMessage = Text::_('COM_COMPONENTBUILDER_THE_OPTION_TO_ADD_A_DYNAMIC_BUTTON_IS_NOT_AVAILABLE_IN_BOWN_CUSTOM_FIELD_TYPESB_YOU_WILL_HAVE_TO_CUSTOM_CODE_IT'); + + $this->app->enqueueMessage($headerMessage, 'Error'); + $this->app->enqueueMessage($detailMessage, 'Error'); + } + + /** + * Prepare the header for a custom field file. + * + * This method sets up the necessary imports and configurations for the header section of a custom field. + * It handles the dynamic setting of comments and import statements based on the field's extension name. + * + * @return void + * @since 3.2.0 + */ + private function prepareCustomFieldHeader(): void + { + // The data set for the custom field + $data = $this->data['custom']; + + // get the default headers + $headers = array_map(function ($h) { + return $this->placeholder->update($h, $this->placeholders); + }, explode( + PHP_EOL, $this->header->get('form.custom.field', $this->baseType) + ) + ); + + if (isset($data['phpHEADER']) && + ArrayHelper::check($data['phpHEADER'])) + { // set tab and break replacements - $tabBreak = array( + $tab_break = array( '\t' => Indent::_(1), '\n' => PHP_EOL ); - // set the [[[PLACEHOLDER]]] options - $replace = array( - Placefix::_('JPREFIX') => $jprefix, - Placefix::_('TABLE') => (isset($data['custom']['table'])) - ? $data['custom']['table'] : '', - Placefix::_('ID') => (isset($data['custom']['id'])) - ? $data['custom']['id'] : '', - Placefix::_('TEXT') => (isset($data['custom']['text'])) - ? $data['custom']['text'] : '', - Placefix::_('CODE_TEXT') => (isset($data['code'], $data['custom']['text'])) - ? $data['code'] . '_' . $data['custom']['text'] : '', - Placefix::_('CODE') => (isset($data['code'])) - ? $data['code'] : '', - Placefix::_('view_type') => $nameSingleCode - . '_' . $data['type'], - Placefix::_('type') => (isset($data['type'])) - ? $data['type'] : '', - Placefix::_('com_component') => (isset($data['custom']['component']) - && StringHelper::check( - $data['custom']['component'] - )) ? StringHelper::safe( - $data['custom']['component'] - ) : 'com_' . $this->config->component_code_name, - // set the generic values - Placefix::_('component') => $this->config->component_code_name, - Placefix::_('Component') => $this->content->get('Component'), - Placefix::_('view') => (isset($data['custom']['view']) - && StringHelper::check( - $data['custom']['view'] - )) ? StringHelper::safe( - $data['custom']['view'] - ) : $nameSingleCode, - Placefix::_('views') => (isset($data['custom']['views']) - && StringHelper::check( - $data['custom']['views'] - )) ? StringHelper::safe( - $data['custom']['views'] - ) : $nameListCode - ); - // now set the ###PLACEHOLDER### options - foreach ($replace as $replacekey => $replacevalue) - { - // update the key value - $replacekey = str_replace( - array(Placefix::b(), Placefix::d()), - array(Placefix::h(), Placefix::h()), $replacekey - ); - // now set the value - $replace[$replacekey] = $replacevalue; - } - // load the global placeholders - foreach ($this->componentplaceholder->get() as $globalPlaceholder => $gloabalValue) - { - $replace[$globalPlaceholder] = $gloabalValue; - } - // start loading the field type - // JPREFIX <<>> - $this->contents->set("{$contents_key}JPREFIX", $jprefix); - // Type <<>> - $this->contents->set("{$contents_key}Type", - StringHelper::safe( - $data['custom']['type'], 'F' - ) - ); - // type <<>> - $this->contents->set("{$contents_key}type", StringHelper::safe($data['custom']['type'])); - // is this a own custom field - if (isset($data['custom']['own_custom'])) + foreach ($data['phpHEADER'] as $line => $code) { - // make sure the button option notice is set to notify the developer that the button option is not available in own custom field types - if (isset($data['custom']['add_button']) - && ($data['custom']['add_button'] === 'true' - || 1 == $data['custom']['add_button'])) + if (StringHelper::check($code)) { - // set error - $this->app->enqueueMessage( - Text::_('COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_BUTTON_ERRORHTHREE'), 'Error' - ); - $this->app->enqueueMessage( - Text::_('COM_COMPONENTBUILDER_THE_OPTION_TO_ADD_A_DYNAMIC_BUTTON_IS_NOT_AVAILABLE_IN_BOWN_CUSTOM_FIELD_TYPESB_YOU_WILL_HAVE_TO_CUSTOM_CODE_IT'), 'Error' - ); + $h = array_map(function ($h) { + return $this->placeholder->update($h, $this->placeholders); + }, explode(PHP_EOL, $this->placeholder->update( + $code, $tab_break + ))); + + $headers = array_merge($headers, $h); } - // load another file - $target = array('admin' => 'customfield'); - $this->structure->build( - $target, 'fieldcustom', $data['custom']['type'] - ); - // get the extends name - $JFORM_extends = StringHelper::safe( - $data['custom']['extends'] - ); - // JFORM_TYPE_HEADER <<>> - $add_default_header = true; - $this->contents->set("{$contents_key}JFORM_TYPE_HEADER", - "//" . Line::_( - __LINE__,__CLASS__ - ) . " Import the " . $JFORM_extends - . " field type classes needed" - ); - // JFORM_extens <<>> - $this->contents->set("{$contents_key}JFORM_extends", $JFORM_extends - ); - // JFORM_EXTENDS <<>> - $this->contents->set("{$contents_key}JFORM_EXTENDS", - StringHelper::safe( - $data['custom']['extends'], 'F' - ) - ); - // JFORM_TYPE_PHP <<>> - $this->contents->set("{$contents_key}JFORM_TYPE_PHP", - PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_( - __LINE__,__CLASS__ - ) . " A " . $data['custom']['own_custom'] . " Field" - ); - // load the other PHP options - foreach ($this->phpFieldArray as $x) - { - // reset the php bucket - $phpBucket = ''; - // only set if available - if (isset($data['custom']['php' . $x]) - && ArrayHelper::check( - $data['custom']['php' . $x] - )) - { - foreach ($data['custom']['php' . $x] as $line => $code) - { - if (StringHelper::check($code)) - { - $phpBucket .= PHP_EOL . $this->placeholder->update( - $code, $tabBreak - ); - } - } - // check if this is header text - if ('HEADER' === $x) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . $this->placeholder->update( - $phpBucket, $replace - ), false - ); - // stop default headers from loading - $add_default_header = false; - } - else - { - // JFORM_TYPE_PHP <<>> - $this->contents->add("{$contents_key}JFORM_TYPE_PHP", - PHP_EOL . $this->placeholder->update( - $phpBucket, $replace - ), false - ); - } - } - } - // check if we should add default header - if ($add_default_header) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "jimport('joomla.form.helper');", - false - ); - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "JFormHelper::loadFieldClass('" . $JFORM_extends . "');", - false - ); - } - // check the the JFormHelper::loadFieldClass(..) was set - elseif (strpos((string) $this->contents->get("{$contents_key}JFORM_TYPE_HEADER"), - 'JFormHelper::loadFieldClass(') === false) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "JFormHelper::loadFieldClass('" - . $JFORM_extends . "');", false - ); - } - } - else - { - // first build the custom field type file - $target = array('admin' => 'customfield'); - $this->structure->build( - $target, 'field' . $data['custom']['extends'], - $data['custom']['type'] - ); - // make sure the value is reset - $phpCode = ''; - // now load the php script - if (isset($data['custom']['php']) - && ArrayHelper::check( - $data['custom']['php'] - )) - { - foreach ($data['custom']['php'] as $line => $code) - { - if (StringHelper::check($code)) - { - if ($line == 1) - { - $phpCode .= $this->placeholder->update( - $code, $tabBreak - ); - } - else - { - $phpCode .= PHP_EOL . Indent::_(2) - . $this->placeholder->update($code, $tabBreak); - } - } - } - // replace the placholders - $phpCode = $this->placeholder->update($phpCode, $replace); - } - // catch empty stuff - if (!StringHelper::check($phpCode)) - { - $phpCode = 'return null;'; - } - // some house cleaning for users - if ($data['custom']['extends'] === 'user') - { - // make sure the value is reset - $phpxCode = ''; - // now load the php xclude script - if (ArrayHelper::check( - $data['custom']['phpx'] - )) - { - foreach ($data['custom']['phpx'] as $line => $code) - { - if (StringHelper::check($code)) - { - if ($line == 1) - { - $phpxCode .= $this->placeholder->update( - $code, $tabBreak - ); - } - else - { - $phpxCode .= PHP_EOL . Indent::_(2) - . $this->placeholder->update( - $code, $tabBreak - ); - } - } - } - // replace the placholders - $phpxCode = $this->placeholder->update($phpxCode, $replace); - } - // catch empty stuff - if (!StringHelper::check($phpxCode)) - { - $phpxCode = 'return null;'; - } - // temp holder for name - $tempName = $data['custom']['label'] . ' Group'; - // set lang - $groupLangName = $this->config->lang_prefix . '_' - . FieldHelper::safe( - $tempName, true - ); - // add to lang array - $this->language->set( - $this->config->lang_target, $groupLangName, - StringHelper::safe($tempName, 'W') - ); - // build the Group Control - $this->fieldgroupcontrol->set($data['type'], $groupLangName); - // JFORM_GETGROUPS_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETGROUPS_PHP", - $phpCode - ); - // JFORM_GETEXCLUDED_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETEXCLUDED_PHP", - $phpxCode - ); - } - else - { - // JFORM_GETOPTIONS_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETOPTIONS_PHP", - $phpCode - ); - } - // type <<>> - $this->contents->set("{$contents_key}ADD_BUTTON", - $this->inputbutton->get($data['custom']) - ); } } - // if this field gets used in plug-in or module we should track it so if needed we can copy it over - if ((strpos($nameSingleCode, 'pLuG!n') !== false || strpos($nameSingleCode, 'M0dUl3') !== false) - && isset($data['custom']) - && isset($data['custom']['type'])) + + // Remove duplicate values + $headers = array_unique($headers); + + // add to the content updating engine + $this->contents->set("{$this->contentsKey}FORM_CUSTOM_FIELD_HEADER", + implode(PHP_EOL, $headers) + ); + } + + /** + * Prepare the body for a custom field file. + * + * This method sets up the necessary imports and configurations for the body section of a custom field. + * It handles the dynamic setting of php code. + * + * @return void + * @since 3.2.0 + */ + private function prepareCustomFieldBody(): void + { + // The own custom string value + $own_custom = $this->data['custom']['own_custom'] ?? $this->baseType; + + // reset the body + $body = []; + + // load the other PHP options + foreach ($this->phpFieldArray as $x) { - $this->extensioncustomfields->set($data['type'], $data['custom']['type']); + if (($code = $this->loadPhpScript('php' . $x, null)) !== null) + { + $body[] = $code; + } } + + $php_body = PHP_EOL . PHP_EOL . Indent::_(1) . "//" . + Line::_(__LINE__,__CLASS__) . + " A " . $own_custom . " Field" . PHP_EOL; + + $php_body .= $this->placeholder->update( + implode(PHP_EOL, $body), + $this->placeholders + ); + + // add to the content updating engine + $this->contents->set("{$this->contentsKey}FORM_CUSTOM_FIELD_PHP", $php_body); + } + + /** + * Load and process a PHP script for the custom field. + * + * @param string $scriptType The type of script to load ('php' or 'phpx'). + * @param string|null $default The default if none is found + * + * @return string|null The processed PHP code. + * @since 3.2.0 + */ + private function loadPhpScript(string $scriptType, ?string $default = 'return null;'): ?string + { + $php_code = ''; + + // The data set for the custom field + $data = $this->data['custom']; + + if (isset($data[$scriptType]) && ArrayHelper::check($data[$scriptType])) + { + $tab_break = [ + '\t' => Indent::_(1), + '\n' => PHP_EOL + ]; + + foreach ($data[$scriptType] as $line => $code) + { + if (StringHelper::check($code)) + { + $php_code .= $line == 1 ? $this->placeholder->update($code, $tab_break) + : PHP_EOL . Indent::_(2) . $this->placeholder->update($code, $tab_break); + } + } + + $php_code = $this->placeholder->update($php_code, $this->placeholders); + } + + return StringHelper::check($php_code) ? $php_code : $default; + } + + /** + * Generate a group language name for the custom field. + * + * @return string The generated group language name. + * @since 3.2.0 + */ + private function generateGroupLanguageName(): string + { + $label = $this->data['custom']['label'] ?? '(error: label not set)'; + $temp_name = $label . ' Group'; + $group_lang_name = $this->config->lang_prefix . '_' . FieldHelper::safe($temp_name, true); + + $this->language->set( + $this->config->lang_target, + $group_lang_name, + StringHelper::safe($temp_name, 'W') + ); + + return $group_lang_name; + } + + /** + * Tracks extension custom fields for plugins or modules. + * + * This method is used to track custom fields when they are utilized in plugins or modules. + * If the field is used in a plugin or module, it records this information, potentially to facilitate + * actions like copying the field over to other parts of the system. + * + * @return void + * @since 3.2.0 + */ + private function trackExtensionCustomFields(): void + { + if ($this->isUsedInPluginOrModule() && $this->customTypeWasSet) + { + $this->extensioncustomfields->set($this->type, $this->baseType); + } + } + + /** + * Determines if the field is used in a plugin or module. + * + * @return bool Returns true if the field is used in a plugin or module, false otherwise. + * @since 3.2.0 + */ + private function isUsedInPluginOrModule(): bool + { + return strpos($this->nameSingleCode, 'pLuG!n') !== false || strpos($this->nameSingleCode, 'M0dUl3') !== false; } } diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power index 6f55d7b..0e06710 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power @@ -86,6 +86,30 @@ */ protected ExtensionCustomFields $extensioncustomfields; + /** + * The HeaderInterface Class. + * + * @var Header + * @since 3.2.0 + */ + protected Header $header; + + /** + * The CoreFieldInterface Class. + * + * @var CoreField + * @since 3.2.0 + */ + protected CoreField $corefield; + + /** + * The core field mapper. + * + * @var array + * @since 3.2.0 + */ + protected array $fieldmap = []; + /** * Application object. * @@ -95,12 +119,93 @@ protected CMSApplication $app; /** - * Array of php fields Allowed (16) + * Array of php fields Allowed (15) * * @var array * @since 3.2.0 **/ - protected array $phpFieldArray = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x', 'HEADER']; + protected array $phpFieldArray = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x']; + + /** + * The Local Placeholder Values. + * + * @var array + * @since 3.2.0 + */ + protected array $placeholders = []; + + /** + * The field data values. + * + * @var array + * @since 3.2.0 + */ + protected array $data; + + /** + * The List Code Name value. + * + * @var string + * @since 3.2.0 + */ + protected string $nameListCode; + + /** + * The Single Code Name value. + * + * @var string + * @since 3.2.0 + */ + protected string $nameSingleCode; + + /** + * The contents key value. + * + * @var string + * @since 3.2.0 + */ + protected string $contentsKey; + + /** + * The type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $type; + + /** + * The base type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $baseType; + + /** + * The raw type field value. + * + * @var string + * @since 3.2.0 + */ + protected string $rawType; + + /** + * The switch to check if the custom + * type field value was set. + * + * @var bool + * @since 3.2.0 + */ + protected bool $customTypeWasSet; + + /** + * The extends field value. + * + * @var string + * @since 3.2.0 + */ + protected string $extends; /** * Constructor. @@ -116,6 +221,8 @@ * @param InputButton $inputbutton The InputButton Class. * @param FieldGroupControl $fieldgroupcontrol The FieldGroupControl Class. * @param ExtensionCustomFields $extensioncustomfields The ExtensionCustomFields Class. + * @param Header $header The HeaderInterface Class. + * @param CoreField $corefield The CoreFieldInterface Class. * @param CMSApplication|null $app The app object. * * @since 3.2.0 @@ -127,7 +234,7 @@ Structure $structure, InputButton $inputbutton, FieldGroupControl $fieldgroupcontrol, ExtensionCustomFields $extensioncustomfields, - ?CMSApplication $app = null) + Header $header, CoreField $corefield, ?CMSApplication $app = null) { $this->config = $config; $this->content = $content; @@ -140,11 +247,17 @@ $this->inputbutton = $inputbutton; $this->fieldgroupcontrol = $fieldgroupcontrol; $this->extensioncustomfields = $extensioncustomfields; + $this->header = $header; + $this->corefield = $corefield; $this->app = $app ?: Factory::getApplication(); } /** - * set Custom Field Type File + * Set Custom Field Type File + * + * This method handles the setting of a custom field type. It checks if the field has already been built, + * handles namespace in the custom field type name, sets various placeholders, and loads the global placeholders. + * Additionally, it manages the setting of dynamic contents based on the field type and other configurations. * * @param array $data The field complete data set * @param string $nameListCode The list view code name @@ -155,333 +268,677 @@ */ public function set(array $data, string $nameListCode, string $nameSingleCode): void { - // make sure it is not already been build or if it is prime - if (isset($data['custom']) && isset($data['custom']['extends']) - && ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) - || !$this->contents->isArray('customfield_' . $data['type'])) - ) + $this->setTypeName($data); + + if (!$this->isFieldBuildable($data)) { - // set J prefix - $jprefix = 'J'; - // check if this field has a dot in field type name - if (strpos((string) $data['type'], '.') !== false) + return; + } + + $this->init($data, $nameSingleCode, $nameListCode); + + if (isset($data['custom']['own_custom'])) + { + $this->handleOwnCustomField(); + } + else + { + $this->handleStandardCustomField(); + } + + // Extension custom fields tracking for plugins or modules + $this->trackExtensionCustomFields(); + } + + /** + * Set the type name of the custom field. + * + * This function checks if there is a namespace in the field type name (indicated by a dot). + * If a namespace exists, it extracts and removes the namespace from the type name. + * + * @param array $data The field data which contains the type name. + * + * @return void + * @since 3.2.0 + */ + private function setTypeName(array $data): void + { + $type_name = $this->rawType = $data['type'] ?? ''; + + $this->customTypeWasSet = isset($data['custom']['type']); + + // Check if the field type name contains a dot, indicating a namespace + if (strpos($type_name, '.') !== false) + { + $dot_type_array = explode('.', $type_name); + + // If there are more than one parts, remove the first part (namespace) + if (count($dot_type_array) > 1) { - // so we have name spacing in custom field type name - $dotTypeArray = explode('.', (string) $data['type']); - // set the J prefix - if (count((array) $dotTypeArray) > 1) - { - $jprefix = strtoupper(array_shift($dotTypeArray)); - } - // update the type name now - $data['type'] = implode('', $dotTypeArray); - $data['custom']['type'] = $data['type']; + array_shift($dot_type_array); // Remove the namespace part } - // set the contents key - $contents_key = "customfield_{$data['type']}|"; + + // Update the type name by concatenating the remaining parts + $type_name = implode('', $dot_type_array); + $data['custom']['type'] = ClassfunctionHelper::safe($type_name); + } + + $base_type = $data['custom']['type'] ?? $type_name; + + $this->baseType = ClassfunctionHelper::safe($base_type); + $this->type = ClassfunctionHelper::safe($type_name); + } + + /** + * Checks if the field is eligible to be built. + * + * This method examines the 'custom' attribute of the field data to determine if the field has + * already been built or if it is marked as 'prime'. It returns true if the field should be built, + * and false otherwise. + * + * @param array $data The field data. + * + * @return bool True if the field is buildable, false otherwise. + * @since 3.2.0 + */ + private function isFieldBuildable(array $data): bool + { + // Check if 'custom' key is set in the data. + if (!isset($data['custom'])) + { + return false; + } + + // Check if 'extends' key is set under 'custom'. + if (!isset($data['custom']['extends'])) + { + return false; + } + + // Check if the field is marked as 'prime' or if it hasn't been built yet. + $isPrime = isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1; + $notBuilt = !$this->contents->isArray('customfield_' . $this->type); + + return $isPrime || $notBuilt; + } + + /** + * The function to set the class values to the current field being build. + * + * @param array $data The field complete data set + * @param string $nameListCode The list view code name + * @param string $nameSingleCode The single view code name + * + * @return void + * @since 3.2.0 + */ + private function init(array $data, string $nameListCode, string $nameSingleCode): void + { + $this->data = $data; + $this->nameListCode = $nameListCode; + $this->nameSingleCode = $nameSingleCode; + $this->contentsKey = "customfield_{$this->baseType}|"; + + $this->jprefix = $this->determineJPrefix(); + $this->extends = ClassfunctionHelper::safe($data['custom']['extends']); + + $this->setLocalPlaceholders(); + $this->setContentPlaceholders(); + } + + /** + * The function to set the default content placeholder. + * + * @return void + * @since 3.2.0 + */ + private function setContentPlaceholders(): void + { + $contents_key = $this->contentsKey; + + // Start loading the field type + $this->contents->set("{$contents_key}JPREFIX", $this->jprefix); + + $this->contents->set("{$contents_key}JFORM_extends", $this->extends); + $this->contents->set("{$contents_key}JFORM_EXTENDS", + StringHelper::safe($this->extends, 'F') + ); + + // if own custom field + if (isset($this->data['custom']['own_custom'])) + { + $this->contents->set("{$contents_key}FORM_EXTENDS", + $this->getClassNameExtends() + ); + } + + $this->contents->set("{$contents_key}type", $this->baseType); + $this->contents->set("{$contents_key}Type", + StringHelper::safe($this->baseType, 'F') + ); + } + + /** + * Determines the J prefix for the field type. + * + * This method extracts the prefix from the field type name if it contains a dot, indicating namespace usage. + * If no dot is present, it defaults to 'J'. + * + * @return string The determined J prefix. + * @since 3.2.0 + */ + private function determineJPrefix(): string + { + // Default prefix + $jprefix = 'J'; + + // Check if the field type name contains a dot, indicating namespace usage + if (strpos($this->rawType, '.') !== false) + { + // Explode the type by dot to get the namespace parts + $dot_type_array = explode('.', $this->rawType); + + // If there are multiple parts, use the first part as the prefix + if (count($dot_type_array) > 1) + { + $jprefix = strtoupper(array_shift($dot_type_array)); + } + } + + return $jprefix; + } + + /** + * Set placeholder options for the custom field. + * + * This method maps various data points to their corresponding placeholders. + * It takes custom field data, view codes, and a J prefix, and prepares an associative array + * of placeholders and their values. + * + * @return void + * @since 3.2.0 + */ + private function setLocalPlaceholders(): void + { + // The data set for the custom field + $data = $this->data; + + // Initialize the array for placeholder options + $placeholders = []; + + // Populate the array with specific placeholder options + $placeholders[Placefix::_('JPREFIX')] = $this->jprefix; + + $placeholders[Placefix::_('JFORM_extends')] = $this->extends; + $placeholders[Placefix::_('JFORM_EXTENDS')] = StringHelper::safe($this->extends, 'F'); + + // if own custom field + if (isset($data['custom']['own_custom'])) + { + $placeholders[Placefix::_('FORM_EXTENDS')] = $this->getClassNameExtends(); + } + + $placeholders[Placefix::_('TABLE')] = $data['custom']['table'] ?? ''; + $placeholders[Placefix::_('ID')] = $data['custom']['id'] ?? ''; + $placeholders[Placefix::_('TEXT')] = $data['custom']['text'] ?? ''; + $placeholders[Placefix::_('CODE_TEXT')] = + isset($data['code'], $data['custom']['text']) ? $data['code'] . '_' . $data['custom']['text'] : ''; + $placeholders[Placefix::_('CODE')] = $data['code'] ?? ''; + + $placeholders[Placefix::_('com_component')] = $this->getComComponentName(); + $placeholders[Placefix::_('component')] = $this->config->component_code_name; + $placeholders[Placefix::_('Component')] = $this->content->get('Component'); + + $placeholders[Placefix::_('type')] = $this->baseType; + $placeholders[Placefix::_('Type')] = StringHelper::safe($this->baseType, 'F'); + + $placeholders[Placefix::_('view_type')] = $this->getViewName() . '_' . $this->baseType; + $placeholders[Placefix::_('view')] = $this->getViewName(); + $placeholders[Placefix::_('views')] = $this->getViewsName(); + + // Gymnastics to help with transition to Joomla 4 + if ($this->config->get('joomla_version', 3) == 4) + { + $placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()'; + $placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()'; + $placeholders['JFactory::'] = 'Factory::'; + $placeholders['JHtml::'] = 'Html::'; + $placeholders['JText::'] = 'Text::'; + $placeholders['JComponentHelper::'] = 'ComponentHelper::'; + } + + $this->placeholders = $placeholders; + + $this->updatePlaceholderValues(); + $this->loadGlobalPlaceholders(); + } + + /** + * Gets the component name for the custom field. + * + * This method extracts the component name from the custom field data. + * If the component name is explicitly set in the custom field data, + * it returns that name after ensuring it's a safe string. Otherwise, + * it defaults to a name constructed from the component code name in the configuration. + * + * @return string The name of the component. + * @since 3.2.0 + */ + private function getComComponentName(): string + { + // Check if the component name is explicitly set in the custom field data + if (isset($this->data['custom']['component']) && StringHelper::check($this->data['custom']['component'])) + { + // Return the safe version of the component name + return StringHelper::safe($this->data['custom']['component']); + } + + // Default to a component name constructed from the component code name in the configuration + return 'com_' . $this->config->component_code_name; + } + + /** + * Determines the view name for a custom field. + * + * This method extracts the view name from the custom field data, with a fallback + * to a provided single view code name if the view name is not explicitly set in the data. + * + * @return string The determined view name. + * @since 3.2.0 + */ + private function getViewName(): string + { + // Check if a specific view name is set in the custom field data + if (isset($this->data['custom']['view']) && StringHelper::check($this->data['custom']['view'])) + { + // If a specific view name is set, use it after sanitizing + return StringHelper::safe($this->data['custom']['view']); + } + + // If no specific view name is set, use the single view code name as a fallback + return $this->nameSingleCode; + } + + /** + * Gets the formatted name for the views associated with the custom field. + * + * This method checks if a specific views name is provided in the custom field data. + * If it is, it formats and returns this name. If not, it defaults to the provided list view name. + * + * @return string The formatted name for the views. + * @since 3.2.0 + */ + private function getViewsName(): string + { + // Check if specific views name is provided in the custom field data + if (isset($this->data['custom']['views']) && StringHelper::check($this->data['custom']['views'])) + { + // If yes, use the provided name after ensuring it is properly formatted + return StringHelper::safe($this->data['custom']['views']); + } + + // If no specific name is provided, default to the provided list view name + return $this->nameListCode; + } + + /** + * Gets the class name being extended. + * + * This method is for the new namespace class name in Joomla 4 and above. + * + * @return string The class being name extended. + * @since 3.2.0 + */ + private function getClassNameExtends(): string + { + if (isset($this->fieldmap[$this->extends])) + { + return $this->fieldmap[$this->extends]; + } + + $core_fields = $this->corefield->get(); + $extends = $this->extends; + + foreach ($core_fields as $core_field) + { + $field = strtolower((string) $core_field); + if ($extends === $field) + { + $this->fieldmap[$extends] = $core_field; + + return $core_field; + } + } + + $this->fieldmap[$extends] = StringHelper::safe($extends, 'F'); + + return $this->fieldmap[$extends]; + } + + /** + * Update placeholder values in the field data. + * + * This function iterates over the given replacements and applies them to the placeholders. + * It updates both the key and value of each placeholder, ensuring that they are correctly set. + * + * @return void + * @since 3.2.0 + */ + private function updatePlaceholderValues(): void + { + foreach ($this->placeholders as $placeholder => $value) + { + // Update the key by replacing the placeholders for before and after + $updatedPlaceholder = str_replace( + [Placefix::b(), Placefix::d()], + [Placefix::h(), Placefix::h()], + $placeholder + ); + + // Update the value in the replacements array + $this->placeholders[$updatedPlaceholder] = $value; + } + } + + /** + * Load global placeholders into the placeholders array. + * + * This method iterates over the global placeholders and adds them to the replace array. + * + * @return void + * @since 3.2.0 + */ + private function loadGlobalPlaceholders(): void + { + foreach ($this->componentplaceholder->get() as $globalPlaceholder => $globalValue) + { + $this->placeholders[$globalPlaceholder] = $globalValue; + } + } + + /** + * Handle the setting of a own custom field. + * + * This method manages the building of the custom field type file, the handling of PHP scripts, + * and specific operations for certain field types like user fields. + * + * @return void + * @since 3.2.0 + */ + private function handleOwnCustomField(): void + { + if ($this->isButtonOptionSet()) + { + $this->setButtonOptionErrorMessages(); + } + + $target = ['admin' => 'customfield']; + $this->structure->build($target, 'fieldcustom', $this->baseType); + + $this->prepareCustomFieldHeader(); + $this->prepareCustomFieldBody(); + } + + /** + * Handle the setting of a standard custom field. + * + * This method manages the building of the custom field type file, the handling of PHP scripts, + * and specific operations for certain field types like user fields. + * + * @return void + * @since 3.2.0 + */ + private function handleStandardCustomField(): void + { + // The key used for setting contents. + $contents_key = $this->contentsKey; + + // Build the custom field type file + $target = ['admin' => 'customfield']; + $this->structure->build( + $target, 'field' . $this->extends, $this->baseType + ); + + $php_code = $this->loadPhpScript('php'); + + if ($this->extends === 'user') + { + $this->fieldgroupcontrol->set( + $this->type, $this->generateGroupLanguageName() + ); + + $phpx_code = $this->loadPhpScript('phpx'); + + $this->contents->set("{$contents_key}JFORM_GETGROUPS_PHP", $php_code); + $this->contents->set("{$contents_key}JFORM_GETEXCLUDED_PHP", $phpx_code); + } + else + { + $this->contents->set("{$contents_key}JFORM_GETOPTIONS_PHP", $php_code); + } + + $this->contents->set("{$contents_key}ADD_BUTTON", $this->inputbutton->get($this->data['custom'])); + } + + /** + * Checks if the button option is set for the custom field. + * + * This function examines the custom field data to determine if the 'add_button' option + * is set and configured to a truthy value. It's used to manage specific behaviors or + * display messages related to the button option in custom fields. + * + * @return bool Returns true if the button option is set and true, otherwise false. + * @since 3.2.0 + */ + private function isButtonOptionSet(): bool + { + // Check if 'own_custom' field is set and if 'add_button' option is available and truthy + if (isset($this->data['custom']['own_custom'], $this->data['custom']['add_button'])) + { + $addButton = $this->data['custom']['add_button']; + return $addButton === 'true' || $addButton === 1; + } + + return false; + } + + /** + * Enqueue error messages related to the dynamic button option in custom fields. + * + * This method adds error messages to the queue when there's an attempt to use the dynamic button + * option in custom field types where it's not supported. It's specifically used in the context of 'own custom' + * field types. + * + * @return void + * @since 3.2.0 + */ + private function setButtonOptionErrorMessages(): void + { + $headerMessage = '

' . Text::_('Dynamic Button Error') . '

'; + $detailMessage = Text::_('The option to add a dynamic button is not available in own custom field types, you will have to custom code it.'); + + $this->app->enqueueMessage($headerMessage, 'Error'); + $this->app->enqueueMessage($detailMessage, 'Error'); + } + + /** + * Prepare the header for a custom field file. + * + * This method sets up the necessary imports and configurations for the header section of a custom field. + * It handles the dynamic setting of comments and import statements based on the field's extension name. + * + * @return void + * @since 3.2.0 + */ + private function prepareCustomFieldHeader(): void + { + // The data set for the custom field + $data = $this->data['custom']; + + // get the default headers + $headers = array_map(function ($h) { + return $this->placeholder->update($h, $this->placeholders); + }, explode( + PHP_EOL, $this->header->get('form.custom.field', $this->baseType) + ) + ); + + if (isset($data['phpHEADER']) && + ArrayHelper::check($data['phpHEADER'])) + { // set tab and break replacements - $tabBreak = array( + $tab_break = array( '\t' => Indent::_(1), '\n' => PHP_EOL ); - // set the [[[PLACEHOLDER]]] options - $replace = array( - Placefix::_('JPREFIX') => $jprefix, - Placefix::_('TABLE') => (isset($data['custom']['table'])) - ? $data['custom']['table'] : '', - Placefix::_('ID') => (isset($data['custom']['id'])) - ? $data['custom']['id'] : '', - Placefix::_('TEXT') => (isset($data['custom']['text'])) - ? $data['custom']['text'] : '', - Placefix::_('CODE_TEXT') => (isset($data['code'], $data['custom']['text'])) - ? $data['code'] . '_' . $data['custom']['text'] : '', - Placefix::_('CODE') => (isset($data['code'])) - ? $data['code'] : '', - Placefix::_('view_type') => $nameSingleCode - . '_' . $data['type'], - Placefix::_('type') => (isset($data['type'])) - ? $data['type'] : '', - Placefix::_('com_component') => (isset($data['custom']['component']) - && StringHelper::check( - $data['custom']['component'] - )) ? StringHelper::safe( - $data['custom']['component'] - ) : 'com_' . $this->config->component_code_name, - // set the generic values - Placefix::_('component') => $this->config->component_code_name, - Placefix::_('Component') => $this->content->get('Component'), - Placefix::_('view') => (isset($data['custom']['view']) - && StringHelper::check( - $data['custom']['view'] - )) ? StringHelper::safe( - $data['custom']['view'] - ) : $nameSingleCode, - Placefix::_('views') => (isset($data['custom']['views']) - && StringHelper::check( - $data['custom']['views'] - )) ? StringHelper::safe( - $data['custom']['views'] - ) : $nameListCode - ); - // now set the ###PLACEHOLDER### options - foreach ($replace as $replacekey => $replacevalue) - { - // update the key value - $replacekey = str_replace( - array(Placefix::b(), Placefix::d()), - array(Placefix::h(), Placefix::h()), $replacekey - ); - // now set the value - $replace[$replacekey] = $replacevalue; - } - // load the global placeholders - foreach ($this->componentplaceholder->get() as $globalPlaceholder => $gloabalValue) - { - $replace[$globalPlaceholder] = $gloabalValue; - } - // start loading the field type - // JPREFIX <<>> - $this->contents->set("{$contents_key}JPREFIX", $jprefix); - // Type <<>> - $this->contents->set("{$contents_key}Type", - StringHelper::safe( - $data['custom']['type'], 'F' - ) - ); - // type <<>> - $this->contents->set("{$contents_key}type", StringHelper::safe($data['custom']['type'])); - // is this a own custom field - if (isset($data['custom']['own_custom'])) + foreach ($data['phpHEADER'] as $line => $code) { - // make sure the button option notice is set to notify the developer that the button option is not available in own custom field types - if (isset($data['custom']['add_button']) - && ($data['custom']['add_button'] === 'true' - || 1 == $data['custom']['add_button'])) + if (StringHelper::check($code)) { - // set error - $this->app->enqueueMessage( - Text::_('

Dynamic Button Error

'), 'Error' - ); - $this->app->enqueueMessage( - Text::_('The option to add a dynamic button is not available in own custom field types, you will have to custom code it.'), 'Error' - ); + $h = array_map(function ($h) { + return $this->placeholder->update($h, $this->placeholders); + }, explode(PHP_EOL, $this->placeholder->update( + $code, $tab_break + ))); + + $headers = array_merge($headers, $h); } - // load another file - $target = array('admin' => 'customfield'); - $this->structure->build( - $target, 'fieldcustom', $data['custom']['type'] - ); - // get the extends name - $JFORM_extends = StringHelper::safe( - $data['custom']['extends'] - ); - // JFORM_TYPE_HEADER <<>> - $add_default_header = true; - $this->contents->set("{$contents_key}JFORM_TYPE_HEADER", - "//" . Line::_( - __LINE__,__CLASS__ - ) . " Import the " . $JFORM_extends - . " field type classes needed" - ); - // JFORM_extens <<>> - $this->contents->set("{$contents_key}JFORM_extends", $JFORM_extends - ); - // JFORM_EXTENDS <<>> - $this->contents->set("{$contents_key}JFORM_EXTENDS", - StringHelper::safe( - $data['custom']['extends'], 'F' - ) - ); - // JFORM_TYPE_PHP <<>> - $this->contents->set("{$contents_key}JFORM_TYPE_PHP", - PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_( - __LINE__,__CLASS__ - ) . " A " . $data['custom']['own_custom'] . " Field" - ); - // load the other PHP options - foreach ($this->phpFieldArray as $x) - { - // reset the php bucket - $phpBucket = ''; - // only set if available - if (isset($data['custom']['php' . $x]) - && ArrayHelper::check( - $data['custom']['php' . $x] - )) - { - foreach ($data['custom']['php' . $x] as $line => $code) - { - if (StringHelper::check($code)) - { - $phpBucket .= PHP_EOL . $this->placeholder->update( - $code, $tabBreak - ); - } - } - // check if this is header text - if ('HEADER' === $x) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . $this->placeholder->update( - $phpBucket, $replace - ), false - ); - // stop default headers from loading - $add_default_header = false; - } - else - { - // JFORM_TYPE_PHP <<>> - $this->contents->add("{$contents_key}JFORM_TYPE_PHP", - PHP_EOL . $this->placeholder->update( - $phpBucket, $replace - ), false - ); - } - } - } - // check if we should add default header - if ($add_default_header) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "jimport('joomla.form.helper');", - false - ); - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "JFormHelper::loadFieldClass('" . $JFORM_extends . "');", - false - ); - } - // check the the JFormHelper::loadFieldClass(..) was set - elseif (strpos((string) $this->contents->get("{$contents_key}JFORM_TYPE_HEADER"), - 'JFormHelper::loadFieldClass(') === false) - { - $this->contents->add("{$contents_key}JFORM_TYPE_HEADER", - PHP_EOL . "JFormHelper::loadFieldClass('" - . $JFORM_extends . "');", false - ); - } - } - else - { - // first build the custom field type file - $target = array('admin' => 'customfield'); - $this->structure->build( - $target, 'field' . $data['custom']['extends'], - $data['custom']['type'] - ); - // make sure the value is reset - $phpCode = ''; - // now load the php script - if (isset($data['custom']['php']) - && ArrayHelper::check( - $data['custom']['php'] - )) - { - foreach ($data['custom']['php'] as $line => $code) - { - if (StringHelper::check($code)) - { - if ($line == 1) - { - $phpCode .= $this->placeholder->update( - $code, $tabBreak - ); - } - else - { - $phpCode .= PHP_EOL . Indent::_(2) - . $this->placeholder->update($code, $tabBreak); - } - } - } - // replace the placholders - $phpCode = $this->placeholder->update($phpCode, $replace); - } - // catch empty stuff - if (!StringHelper::check($phpCode)) - { - $phpCode = 'return null;'; - } - // some house cleaning for users - if ($data['custom']['extends'] === 'user') - { - // make sure the value is reset - $phpxCode = ''; - // now load the php xclude script - if (ArrayHelper::check( - $data['custom']['phpx'] - )) - { - foreach ($data['custom']['phpx'] as $line => $code) - { - if (StringHelper::check($code)) - { - if ($line == 1) - { - $phpxCode .= $this->placeholder->update( - $code, $tabBreak - ); - } - else - { - $phpxCode .= PHP_EOL . Indent::_(2) - . $this->placeholder->update( - $code, $tabBreak - ); - } - } - } - // replace the placholders - $phpxCode = $this->placeholder->update($phpxCode, $replace); - } - // catch empty stuff - if (!StringHelper::check($phpxCode)) - { - $phpxCode = 'return null;'; - } - // temp holder for name - $tempName = $data['custom']['label'] . ' Group'; - // set lang - $groupLangName = $this->config->lang_prefix . '_' - . FieldHelper::safe( - $tempName, true - ); - // add to lang array - $this->language->set( - $this->config->lang_target, $groupLangName, - StringHelper::safe($tempName, 'W') - ); - // build the Group Control - $this->fieldgroupcontrol->set($data['type'], $groupLangName); - // JFORM_GETGROUPS_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETGROUPS_PHP", - $phpCode - ); - // JFORM_GETEXCLUDED_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETEXCLUDED_PHP", - $phpxCode - ); - } - else - { - // JFORM_GETOPTIONS_PHP <<>> - $this->contents->set("{$contents_key}JFORM_GETOPTIONS_PHP", - $phpCode - ); - } - // type <<>> - $this->contents->set("{$contents_key}ADD_BUTTON", - $this->inputbutton->get($data['custom']) - ); } } - // if this field gets used in plug-in or module we should track it so if needed we can copy it over - if ((strpos($nameSingleCode, 'pLuG!n') !== false || strpos($nameSingleCode, 'M0dUl3') !== false) - && isset($data['custom']) - && isset($data['custom']['type'])) + + // Remove duplicate values + $headers = array_unique($headers); + + // add to the content updating engine + $this->contents->set("{$this->contentsKey}FORM_CUSTOM_FIELD_HEADER", + implode(PHP_EOL, $headers) + ); + } + + /** + * Prepare the body for a custom field file. + * + * This method sets up the necessary imports and configurations for the body section of a custom field. + * It handles the dynamic setting of php code. + * + * @return void + * @since 3.2.0 + */ + private function prepareCustomFieldBody(): void + { + // The own custom string value + $own_custom = $this->data['custom']['own_custom'] ?? $this->baseType; + + // reset the body + $body = []; + + // load the other PHP options + foreach ($this->phpFieldArray as $x) { - $this->extensioncustomfields->set($data['type'], $data['custom']['type']); + if (($code = $this->loadPhpScript('php' . $x, null)) !== null) + { + $body[] = $code; + } } + + $php_body = PHP_EOL . PHP_EOL . Indent::_(1) . "//" . + Line::_(__LINE__,__CLASS__) . + " A " . $own_custom . " Field" . PHP_EOL; + + $php_body .= $this->placeholder->update( + implode(PHP_EOL, $body), + $this->placeholders + ); + + // add to the content updating engine + $this->contents->set("{$this->contentsKey}FORM_CUSTOM_FIELD_PHP", $php_body); + } + + /** + * Load and process a PHP script for the custom field. + * + * @param string $scriptType The type of script to load ('php' or 'phpx'). + * @param string|null $default The default if none is found + * + * @return string|null The processed PHP code. + * @since 3.2.0 + */ + private function loadPhpScript(string $scriptType, ?string $default = 'return null;'): ?string + { + $php_code = ''; + + // The data set for the custom field + $data = $this->data['custom']; + + if (isset($data[$scriptType]) && ArrayHelper::check($data[$scriptType])) + { + $tab_break = [ + '\t' => Indent::_(1), + '\n' => PHP_EOL + ]; + + foreach ($data[$scriptType] as $line => $code) + { + if (StringHelper::check($code)) + { + $php_code .= $line == 1 ? $this->placeholder->update($code, $tab_break) + : PHP_EOL . Indent::_(2) . $this->placeholder->update($code, $tab_break); + } + } + + $php_code = $this->placeholder->update($php_code, $this->placeholders); + } + + return StringHelper::check($php_code) ? $php_code : $default; + } + + /** + * Generate a group language name for the custom field. + * + * @return string The generated group language name. + * @since 3.2.0 + */ + private function generateGroupLanguageName(): string + { + $label = $this->data['custom']['label'] ?? '(error: label not set)'; + $temp_name = $label . ' Group'; + $group_lang_name = $this->config->lang_prefix . '_' . FieldHelper::safe($temp_name, true); + + $this->language->set( + $this->config->lang_target, + $group_lang_name, + StringHelper::safe($temp_name, 'W') + ); + + return $group_lang_name; + } + + /** + * Tracks extension custom fields for plugins or modules. + * + * This method is used to track custom fields when they are utilized in plugins or modules. + * If the field is used in a plugin or module, it records this information, potentially to facilitate + * actions like copying the field over to other parts of the system. + * + * @return void + * @since 3.2.0 + */ + private function trackExtensionCustomFields(): void + { + if ($this->isUsedInPluginOrModule() && $this->customTypeWasSet) + { + $this->extensioncustomfields->set($this->type, $this->baseType); + } + } + + /** + * Determines if the field is used in a plugin or module. + * + * @return bool Returns true if the field is used in a plugin or module, false otherwise. + * @since 3.2.0 + */ + private function isUsedInPluginOrModule(): bool + { + return strpos($this->nameSingleCode, 'pLuG!n') !== false || strpos($this->nameSingleCode, 'M0dUl3') !== false; } \ No newline at end of file diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json index b910ad0..fbcdd14 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json @@ -44,7 +44,7 @@ }, "use_selection8": { "use": "c600f58c-3fe2-4d2d-b711-2660eab6effe", - "as": "default" + "as": "InputButton" }, "use_selection9": { "use": "d5530adf-c809-45a9-87fc-7cecd3d972d8", @@ -55,26 +55,38 @@ "as": "default" }, "use_selection11": { + "use": "3a777d70-52ad-49ec-9016-6f7438608613", + "as": "Header" + }, + "use_selection12": { + "use": "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900", + "as": "CoreField" + }, + "use_selection13": { "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", "as": "default" }, - "use_selection12": { + "use_selection14": { "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", "as": "default" }, - "use_selection13": { - "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", - "as": "default" - }, - "use_selection14": { - "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", - "as": "default" - }, "use_selection15": { - "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", "as": "default" }, "use_selection16": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection17": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection18": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection19": { "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", "as": "default" } diff --git a/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php index 2a0dec8..5135b50 100644 --- a/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php +++ b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php @@ -282,8 +282,8 @@ class Autoloader // 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) {'; + . Line::_(__Line__, __Class__) . ' register additional 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 = ['; diff --git a/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.power b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.power index aba5765..f6cca26 100644 --- a/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.power +++ b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.power @@ -253,8 +253,8 @@ // 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) {'; + . Line::_(__Line__, __Class__) . ' register additional 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 = ['; diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md index c1a839f..7e22702 100644 --- a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md @@ -17,7 +17,7 @@ class Data #Gold { # Gui $gui # FieldData $field # Filesfolders $filesFolders - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?Registry $registry = null, ...) + get(int $id) : object|bool } @@ -34,7 +34,6 @@ note right of Data::__construct ?Gui $gui = null ?FieldData $field = null ?Filesfolders $filesFolders = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php index ab27101..3cde60f 100644 --- a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php @@ -83,10 +83,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -97,14 +96,12 @@ class Data * @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) + ?FieldData $field = null, ?Filesfolders $filesFolders = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -112,7 +109,7 @@ class Data $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->field = $field ?: Compiler::_('Field.Data'); $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.power b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.power index a5ae32b..0394071 100644 --- a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.power +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.power @@ -49,10 +49,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -63,14 +62,12 @@ * @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) + ?FieldData $field = null, ?Filesfolders $filesFolders = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -78,7 +75,7 @@ $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->field = $field ?: Compiler::_('Field.Data'); $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md b/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md index cb1039e..e4837ed 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md @@ -18,13 +18,22 @@ class Injector << (F,LightGreen) >> #RoyalBlue { # array $map # array $useStatements # array $traits + # array $other + # array $duplicate + __construct(?Power $power = null, ?Extractor $extractor = null, ...) + power(string $code) : string # update(array $guids, string $code) : string # inspect(object $power, ?array $useStatements, ...) : ?string - # getName(string $useStatement) : ?string - # getUniqueName(string $name, string $namespace, ...) : string - # removeLastSpace(string $namespace) : string + # buildNamespaceStatment(object $power) : string + # extractUseStatements(string $useStatement, string $className, ...) : array + # isUseStatementEqual(string $useStatement, string $namespaceStatement) : bool + # extractClassNameOrAlias(string $useStatement) : ?string + # getUniqueName(string $name, object $power) : string + # extractLastNameFromNamespace(string $namespace) : ?string + # removeLastNameFromNamespace(string $namespace) : string + # shouldAddTraitStatement(object $power) : bool + # handleTraitLogic(string $name, object $power, ...) : void + # addUseStatement(string $name, string $className, ...) : void # addUseStatements(string $code, ?array $useStatements) : string # addLines(string $code, string $lines) : string # addLinesAfterDefinedLine(string $code, string $lines) : string @@ -57,7 +66,9 @@ note right of Injector::update end note note left of Injector::inspect - inspect the super power + Inspect the super power to determine the necessary class name based on use statements and traits. +It checks if the given power (class, trait, etc.) already has a corresponding use statement +and handles the naming accordingly to avoid conflicts. since: 3.2.0 return: ?string @@ -68,47 +79,114 @@ note left of Injector::inspect ?array $traits end note -note right of Injector::getName - Extracts the class name from a use statement. +note right of Injector::buildNamespaceStatment + Builds the namespace statement from the power object's namespace and class name. + + since: 3.2.0 + return: string +end note + +note left of Injector::extractUseStatements + Extracts and processes use statements to find if the current class name is already used. +It identifies any potential naming conflicts. + + since: 3.2.0 + return: array + + arguments: + string $useStatement + string $className + ?array $useStatements +end note + +note right of Injector::isUseStatementEqual + Checks if the namespace statement is already declared in the current use statements. +This method uses a regular expression to check for an exact match of the full statement, +taking into account the possibility of an alias being used. + + return: bool +end note + +note left of Injector::extractClassNameOrAlias + Extracts the class name or alias from a use statement. +This method parses a PHP 'use' statement and extracts either the class name or its alias. +If the statement doesn't match the expected format, or if no class name or alias is found, +the method returns null. +Example: +- 'use Namespace\ClassName;' -> returns 'ClassName' +- 'use Namespace\ClassName as Alias;' -> returns 'Alias' since: 3.2.0 return: ?string end note -note left of Injector::getUniqueName - Removes the last space from the namespace. +note right of Injector::getUniqueName + Ensures the name for the use statement is unique, avoiding conflicts with other classes. since: 3.2.0 return: string +end note + +note left of Injector::extractLastNameFromNamespace + Extracts the last part of a namespace string, which is typically the class name. + + since: 3.2.0 + return: ?string +end note + +note right of Injector::removeLastNameFromNamespace + Removes the last name from the namespace. + + since: 3.2.0 + return: string +end note + +note left of Injector::shouldAddTraitStatement + Determines whether a trait statement should be added. + + since: 3.2.0 + return: bool +end note + +note right of Injector::handleTraitLogic + Handles specific logic for traits, such as checking if the trait is already used. + + since: 3.2.0 + return: void arguments: string $name - string $namespace - array $useOther + object $power + ?array $traits end note -note right of Injector::removeLastSpace - Removes the last space from the namespace. +note left of Injector::addUseStatement + Adds a use statement to the class if it's not already present. since: 3.2.0 - return: string + return: void + + arguments: + string $name + string $className + string $namespaceStatement end note -note left of Injector::addUseStatements +note right of Injector::addUseStatements Insert a line before the class declaration in the given class code. since: 3.2.0 return: string end note -note right of Injector::addLines +note left of Injector::addLines Insert a line before the class declaration in the given class code. since: 3.2.0 return: string end note -note left of Injector::addLinesAfterDefinedLine +note right of Injector::addLinesAfterDefinedLine Inserts a new line after the defined('_JEXEC') line. since: 3.2.0 diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php index e650f4b..246a7ac 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php @@ -81,6 +81,22 @@ final class Injector */ protected array $traits = []; + /** + * Other Statements + * + * @var array + * @since 3.2.0 + */ + protected array $other = []; + + /** + * Duplicate Statements + * + * @var array + * @since 3.2.0 + */ + protected array $duplicate = []; + /** * Constructor. * @@ -138,6 +154,8 @@ final class Injector $this->map = []; $this->useStatements = []; $this->traits = []; + $this->other = []; + $this->duplicate = []; foreach ($guids as $key => $guid) { @@ -165,168 +183,200 @@ final class Injector } /** - * inspect the super power + * Inspect the super power to determine the necessary class name based on use statements and traits. + * It checks if the given power (class, trait, etc.) already has a corresponding use statement + * and handles the naming accordingly to avoid conflicts. * - * @param object|null $power The power object. - * @param array|null $useStatements The code use statments - * @param array|null $traits The code traits use statments + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $useStatements Array of existing use statements in the code. + * @param array|null $traits Array of existing traits used in the code. * - * @return string|null The class name (or as name) + * @return string|null The determined class name, or null if the type is not valid. * @since 3.2.0 */ protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string { - if (isset($power->type) && in_array($power->type, ['class', 'abstract class', 'final class', 'trait'])) - { - $statement = 'use ' . $power->_namespace . '\\' . $power->class_name; - // other class names - $use_other = []; - $trait_other = []; - // some tracker globals - $has_use_statement = false; // add if not found - $has_trait_statement = !('trait' === $power->type); // don't add if not trait - $name = null; - $trait_name = null; + $namespaceStatement = $this->buildNamespaceStatment($power); - // check if the name space is loaded - if ($useStatements !== null) + $use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements); + + $name = $use_extracted['found'] ?? $power->class_name; + + $name = $this->getUniqueName($name, $power); + + $this->handleTraitLogic($name, $power, $traits); + + if (!$use_extracted['hasStatement']) + { + $this->addUseStatement($name, $power->class_name, $namespaceStatement); + } + + return $name; + } + + /** + * Builds the namespace statement from the power object's namespace and class name. + * + * @param object $power The power object. + * + * @return string The constructed use statement. + * @since 3.2.0 + */ + protected function buildNamespaceStatment(object $power): string + { + return $power->_namespace . '\\' . $power->class_name; + } + + /** + * Extracts and processes use statements to find if the current class name is already used. + * It identifies any potential naming conflicts. + * + * @param string $useStatement The search statement of the current class. + * @param string $className The class name of the power object. + * @param array|null $useStatements The existing use statements. + * + * @return array An array with keys 'found' and 'hasStatement'. + * @since 3.2.0 + */ + protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array + { + $results = ['found' => null, 'hasStatement' => false]; + + if ($useStatements !== null) + { + foreach ($useStatements as $use_statement) { - foreach ($useStatements as $use_statement) + $class_name = $this->extractClassNameOrAlias($use_statement); + + if ($this->isUseStatementEqual($use_statement, $useStatement)) { - if ($use_statement === $statement . ';' || strpos($use_statement, $statement . ' as ') !== false) + if ($results['found'] === null) { - $name = $this->getName($use_statement); - $has_use_statement = true; + $results['found'] = $class_name; + $results['hasStatement'] = true; } else { - $tmp = $this->getName($use_statement); - if ($power->class_name === $tmp) - { - $use_other[$tmp] = $tmp; - } + // TODO we need to backport fix these + $this->duplicate[$use_statement] = $class_name; } } - } - - // check if the trait is loaded - if (!$has_trait_statement && $traits !== null) - { - $trait_statement = $name ?? $power->class_name; - - foreach ($traits as $trait) + elseif ($className === $class_name) { - if ($trait === $trait_statement) - { - $trait_name = $trait; - $has_trait_statement = true; - } + $this->other[$className] = $class_name; } } - - // build the name - $name = $trait_name ?? $name ?? $power->class_name; - - // if we have a trait we may need to add use and trait - if ('trait' === $power->type) - { - if (!$has_trait_statement) - { - $this->traits[$name] = 'use ' . $name . ';'; - } - } - - // check if we need to update the name - if ($use_other !== []) - { - // set search namespace - $namespace = ($name !== $power->class_name) ? $power->_namespace . '\\' . $power->class_name : $power->_namespace; - - // get the unique name - $name = $this->getUniqueName($name, $namespace, $use_other); - } - - if (!$has_use_statement) - { - // if the name is not the same as class name - if ($name !== $power->class_name) - { - $statement .= ' as ' . $name . ';'; - } - else - { - $statement .= ';'; - } - - $this->useStatements[$name] = $statement; - } - - return $name; } - return null; + return $results; } /** - * Extracts the class name from a use statement. + * Checks if the namespace statement is already declared in the current use statements. * - * @param string $useStatement The use statement from which to extract the class name + * This method uses a regular expression to check for an exact match of the full statement, + * taking into account the possibility of an alias being used. * - * @return string|null The class name or null if not found + * @param string $useStatement The existing use statement to check against. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @return bool True if the full statement is found, false otherwise. + */ + protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool + { + // Create a regular expression pattern to match the full statement + // The pattern checks for the start of the statement, optional whitespace, + // and an optional alias after the full statement. + $pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/'; + + // Perform the regex match to check if the use statement is equal to the search statment + return (bool) preg_match($pattern, $useStatement); + } + + /** + * Extracts the class name or alias from a use statement. + * + * This method parses a PHP 'use' statement and extracts either the class name or its alias. + * If the statement doesn't match the expected format, or if no class name or alias is found, + * the method returns null. + * + * Example: + * - 'use Namespace\ClassName;' -> returns 'ClassName' + * - 'use Namespace\ClassName as Alias;' -> returns 'Alias' + * + * @param string $useStatement The use statement from which to extract the class name or alias. + * + * @return string|null The class name or alias if found, null otherwise. * @since 3.2.0 */ - protected function getName(string $useStatement): ?string + protected function extractClassNameOrAlias(string $useStatement): ?string { - // If the input doesn't start with 'use ', assume it's a class name without a use statement + // If the input doesn't start with 'use ', assume it's just the namespace without a use statement if (strpos($useStatement, 'use ') !== 0) { - $parts = explode('\\', $useStatement); - $result = end($parts); - - // Remove '\\' from the beginning and end of the resulting string - $result = trim($result, '\\'); - - // If the resulting string is empty, return null - return empty($result) ? null : $result; + return $this->extractLastNameFromNamespace($useStatement); } - $pattern = '/use\s+([\w\\\\]+)(?:\s+as\s+)?([\w]+)?;/'; + // Regular expression to extract the class name and alias from the use statement + $pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/'; if (preg_match($pattern, $useStatement, $matches)) { - // If there's an alias, return it - if (!empty($matches[2])) - { - return $matches[2]; - } - - // If there's no alias, extract the class name from the namespace - $parts = explode('\\', $matches[1]); - return end($parts); + // Return the alias if it exists; otherwise, return the last part of the namespace (class name) + return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']); } + // Return null if no match is found return null; } /** - * Removes the last space from the namespace. + * Ensures the name for the use statement is unique, avoiding conflicts with other classes. * - * @param string $name The current name - * @param string $namespace The namespace - * @param array $useOther The other use names + * @param string $name The current name + * @param object $power The power object containing type, namespace, and class name. * - * @return string The namespace shortened + * @return string The unique name * @since 3.2.0 */ - protected function getUniqueName(string $name, string $namespace, array $useOther): string + protected function getUniqueName(string $name, object $power): string { - // if the name is already used - while (isset($useOther[$name])) + // set search namespace + $namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace; + + // check if we need to update the name + if (isset($this->other[$name])) { - if (($tmp = $this->getName($namespace)) !== null) + // if the name is already used + while (isset($this->other[$name])) { - $name = ucfirst($tmp) . $name; - $namespace = $this->removeLastSpace($namespace); + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } + } + } + + // also loop new found use statements + if (isset($this->useStatements[$name])) + { + // if the name is already used + while (isset($this->useStatements[$name])) + { + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } } } @@ -334,14 +384,34 @@ final class Injector } /** - * Removes the last space from the namespace. + * Extracts the last part of a namespace string, which is typically the class name. + * + * @param string $namespace The namespace string to extract from. + * + * @return string|null The extracted class name. + * @since 3.2.0 + */ + protected function extractLastNameFromNamespace(string $namespace): ?string + { + $parts = explode('\\', $namespace); + $result = end($parts); + + // Remove '\\' from the beginning and end of the resulting string + $result = trim($result, '\\'); + + // If the resulting string is empty, return null + return empty($result) ? null : $result; + } + + /** + * Removes the last name from the namespace. * * @param string $namespace The namespace * * @return string The namespace shortened * @since 3.2.0 */ - protected function removeLastSpace(string $namespace): string + protected function removeLastNameFromNamespace(string $namespace): string { // Remove '\\' from the beginning and end of the resulting string $namespace = trim($namespace, '\\'); @@ -355,6 +425,69 @@ final class Injector return implode('\\', $parts); } + /** + * Determines whether a trait statement should be added. + * + * @param object $power The power object. + * + * @return bool True if a trait statement should be added, false otherwise. + * @since 3.2.0 + */ + protected function shouldAddTraitStatement(object $power): bool + { + return $power->type === 'trait'; + } + + /** + * Handles specific logic for traits, such as checking if the trait is already used. + * + * @param string $name The current name. + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $traits The traits used in the code. + * + * @return void + * @since 3.2.0 + */ + protected function handleTraitLogic(string $name, object $power, ?array $traits): void + { + if ($this->shouldAddTraitStatement($power) && $traits !== null) + { + foreach ($traits as $trait) + { + if ($trait === $name) + { + return; + } + } + } + + // add the trait + $this->traits[$name] = 'use ' . $name . ';'; + } + + /** + * Adds a use statement to the class if it's not already present. + * + * @param string $name The name to use. + * @param string $className The class name of the power object. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @since 3.2.0 + */ + protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void + { + if ($name !== $className) + { + $statement = 'use ' . $namespaceStatement . ' as ' . $name . ';'; + } + else + { + $statement = 'use ' . $namespaceStatement . ';'; + } + + $this->useStatements[$name] = $statement; + } + /** * Insert a line before the class declaration in the given class code. * @@ -405,7 +538,7 @@ final class Injector // Find the position of the comment block right before the class declaration $comment_pattern = '/\s*\*\/\s*$/m'; $insert_pos = null; - if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]); } @@ -413,7 +546,7 @@ final class Injector { // Find the last empty line before the class declaration $empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/'; - if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]); } @@ -444,7 +577,9 @@ final class Injector // Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines $patterns = [ "/defined\('_JEXEC'\)(.*?)\s*;/", + "/\\defined\('_JEXEC'\)(.*?)\s*;/", "/defined\('JPATH_BASE'\)(.*?)\s*;/", + "/\\defined\('JPATH_BASE'\)(.*?)\s*;/", ]; $insert_pos = null; diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power index 95b7f8c..f18fec7 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power @@ -54,6 +54,22 @@ */ protected array $traits = []; + /** + * Other Statements + * + * @var array + * @since 3.2.0 + */ + protected array $other = []; + + /** + * Duplicate Statements + * + * @var array + * @since 3.2.0 + */ + protected array $duplicate = []; + /** * Constructor. * @@ -111,6 +127,8 @@ $this->map = []; $this->useStatements = []; $this->traits = []; + $this->other = []; + $this->duplicate = []; foreach ($guids as $key => $guid) { @@ -138,168 +156,200 @@ } /** - * inspect the super power + * Inspect the super power to determine the necessary class name based on use statements and traits. + * It checks if the given power (class, trait, etc.) already has a corresponding use statement + * and handles the naming accordingly to avoid conflicts. * - * @param object|null $power The power object. - * @param array|null $useStatements The code use statments - * @param array|null $traits The code traits use statments + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $useStatements Array of existing use statements in the code. + * @param array|null $traits Array of existing traits used in the code. * - * @return string|null The class name (or as name) + * @return string|null The determined class name, or null if the type is not valid. * @since 3.2.0 */ protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string { - if (isset($power->type) && in_array($power->type, ['class', 'abstract class', 'final class', 'trait'])) - { - $statement = 'use ' . $power->_namespace . '\\' . $power->class_name; - // other class names - $use_other = []; - $trait_other = []; - // some tracker globals - $has_use_statement = false; // add if not found - $has_trait_statement = !('trait' === $power->type); // don't add if not trait - $name = null; - $trait_name = null; + $namespaceStatement = $this->buildNamespaceStatment($power); - // check if the name space is loaded - if ($useStatements !== null) + $use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements); + + $name = $use_extracted['found'] ?? $power->class_name; + + $name = $this->getUniqueName($name, $power); + + $this->handleTraitLogic($name, $power, $traits); + + if (!$use_extracted['hasStatement']) + { + $this->addUseStatement($name, $power->class_name, $namespaceStatement); + } + + return $name; + } + + /** + * Builds the namespace statement from the power object's namespace and class name. + * + * @param object $power The power object. + * + * @return string The constructed use statement. + * @since 3.2.0 + */ + protected function buildNamespaceStatment(object $power): string + { + return $power->_namespace . '\\' . $power->class_name; + } + + /** + * Extracts and processes use statements to find if the current class name is already used. + * It identifies any potential naming conflicts. + * + * @param string $useStatement The search statement of the current class. + * @param string $className The class name of the power object. + * @param array|null $useStatements The existing use statements. + * + * @return array An array with keys 'found' and 'hasStatement'. + * @since 3.2.0 + */ + protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array + { + $results = ['found' => null, 'hasStatement' => false]; + + if ($useStatements !== null) + { + foreach ($useStatements as $use_statement) { - foreach ($useStatements as $use_statement) + $class_name = $this->extractClassNameOrAlias($use_statement); + + if ($this->isUseStatementEqual($use_statement, $useStatement)) { - if ($use_statement === $statement . ';' || strpos($use_statement, $statement . ' as ') !== false) + if ($results['found'] === null) { - $name = $this->getName($use_statement); - $has_use_statement = true; + $results['found'] = $class_name; + $results['hasStatement'] = true; } else { - $tmp = $this->getName($use_statement); - if ($power->class_name === $tmp) - { - $use_other[$tmp] = $tmp; - } + // TODO we need to backport fix these + $this->duplicate[$use_statement] = $class_name; } } - } - - // check if the trait is loaded - if (!$has_trait_statement && $traits !== null) - { - $trait_statement = $name ?? $power->class_name; - - foreach ($traits as $trait) + elseif ($className === $class_name) { - if ($trait === $trait_statement) - { - $trait_name = $trait; - $has_trait_statement = true; - } + $this->other[$className] = $class_name; } } - - // build the name - $name = $trait_name ?? $name ?? $power->class_name; - - // if we have a trait we may need to add use and trait - if ('trait' === $power->type) - { - if (!$has_trait_statement) - { - $this->traits[$name] = 'use ' . $name . ';'; - } - } - - // check if we need to update the name - if ($use_other !== []) - { - // set search namespace - $namespace = ($name !== $power->class_name) ? $power->_namespace . '\\' . $power->class_name : $power->_namespace; - - // get the unique name - $name = $this->getUniqueName($name, $namespace, $use_other); - } - - if (!$has_use_statement) - { - // if the name is not the same as class name - if ($name !== $power->class_name) - { - $statement .= ' as ' . $name . ';'; - } - else - { - $statement .= ';'; - } - - $this->useStatements[$name] = $statement; - } - - return $name; } - return null; + return $results; } /** - * Extracts the class name from a use statement. + * Checks if the namespace statement is already declared in the current use statements. * - * @param string $useStatement The use statement from which to extract the class name + * This method uses a regular expression to check for an exact match of the full statement, + * taking into account the possibility of an alias being used. * - * @return string|null The class name or null if not found + * @param string $useStatement The existing use statement to check against. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @return bool True if the full statement is found, false otherwise. + */ + protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool + { + // Create a regular expression pattern to match the full statement + // The pattern checks for the start of the statement, optional whitespace, + // and an optional alias after the full statement. + $pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/'; + + // Perform the regex match to check if the use statement is equal to the search statment + return (bool) preg_match($pattern, $useStatement); + } + + /** + * Extracts the class name or alias from a use statement. + * + * This method parses a PHP 'use' statement and extracts either the class name or its alias. + * If the statement doesn't match the expected format, or if no class name or alias is found, + * the method returns null. + * + * Example: + * - 'use Namespace\ClassName;' -> returns 'ClassName' + * - 'use Namespace\ClassName as Alias;' -> returns 'Alias' + * + * @param string $useStatement The use statement from which to extract the class name or alias. + * + * @return string|null The class name or alias if found, null otherwise. * @since 3.2.0 */ - protected function getName(string $useStatement): ?string + protected function extractClassNameOrAlias(string $useStatement): ?string { - // If the input doesn't start with 'use ', assume it's a class name without a use statement + // If the input doesn't start with 'use ', assume it's just the namespace without a use statement if (strpos($useStatement, 'use ') !== 0) { - $parts = explode('\\', $useStatement); - $result = end($parts); - - // Remove '\\' from the beginning and end of the resulting string - $result = trim($result, '\\'); - - // If the resulting string is empty, return null - return empty($result) ? null : $result; + return $this->extractLastNameFromNamespace($useStatement); } - $pattern = '/use\s+([\w\\\\]+)(?:\s+as\s+)?([\w]+)?;/'; + // Regular expression to extract the class name and alias from the use statement + $pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/'; if (preg_match($pattern, $useStatement, $matches)) { - // If there's an alias, return it - if (!empty($matches[2])) - { - return $matches[2]; - } - - // If there's no alias, extract the class name from the namespace - $parts = explode('\\', $matches[1]); - return end($parts); + // Return the alias if it exists; otherwise, return the last part of the namespace (class name) + return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']); } + // Return null if no match is found return null; } /** - * Removes the last space from the namespace. + * Ensures the name for the use statement is unique, avoiding conflicts with other classes. * - * @param string $name The current name - * @param string $namespace The namespace - * @param array $useOther The other use names + * @param string $name The current name + * @param object $power The power object containing type, namespace, and class name. * - * @return string The namespace shortened + * @return string The unique name * @since 3.2.0 */ - protected function getUniqueName(string $name, string $namespace, array $useOther): string + protected function getUniqueName(string $name, object $power): string { - // if the name is already used - while (isset($useOther[$name])) + // set search namespace + $namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace; + + // check if we need to update the name + if (isset($this->other[$name])) { - if (($tmp = $this->getName($namespace)) !== null) + // if the name is already used + while (isset($this->other[$name])) { - $name = ucfirst($tmp) . $name; - $namespace = $this->removeLastSpace($namespace); + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } + } + } + + // also loop new found use statements + if (isset($this->useStatements[$name])) + { + // if the name is already used + while (isset($this->useStatements[$name])) + { + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } } } @@ -307,14 +357,34 @@ } /** - * Removes the last space from the namespace. + * Extracts the last part of a namespace string, which is typically the class name. + * + * @param string $namespace The namespace string to extract from. + * + * @return string|null The extracted class name. + * @since 3.2.0 + */ + protected function extractLastNameFromNamespace(string $namespace): ?string + { + $parts = explode('\\', $namespace); + $result = end($parts); + + // Remove '\\' from the beginning and end of the resulting string + $result = trim($result, '\\'); + + // If the resulting string is empty, return null + return empty($result) ? null : $result; + } + + /** + * Removes the last name from the namespace. * * @param string $namespace The namespace * * @return string The namespace shortened * @since 3.2.0 */ - protected function removeLastSpace(string $namespace): string + protected function removeLastNameFromNamespace(string $namespace): string { // Remove '\\' from the beginning and end of the resulting string $namespace = trim($namespace, '\\'); @@ -328,6 +398,69 @@ return implode('\\', $parts); } + /** + * Determines whether a trait statement should be added. + * + * @param object $power The power object. + * + * @return bool True if a trait statement should be added, false otherwise. + * @since 3.2.0 + */ + protected function shouldAddTraitStatement(object $power): bool + { + return $power->type === 'trait'; + } + + /** + * Handles specific logic for traits, such as checking if the trait is already used. + * + * @param string $name The current name. + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $traits The traits used in the code. + * + * @return void + * @since 3.2.0 + */ + protected function handleTraitLogic(string $name, object $power, ?array $traits): void + { + if ($this->shouldAddTraitStatement($power) && $traits !== null) + { + foreach ($traits as $trait) + { + if ($trait === $name) + { + return; + } + } + } + + // add the trait + $this->traits[$name] = 'use ' . $name . ';'; + } + + /** + * Adds a use statement to the class if it's not already present. + * + * @param string $name The name to use. + * @param string $className The class name of the power object. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @since 3.2.0 + */ + protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void + { + if ($name !== $className) + { + $statement = 'use ' . $namespaceStatement . ' as ' . $name . ';'; + } + else + { + $statement = 'use ' . $namespaceStatement . ';'; + } + + $this->useStatements[$name] = $statement; + } + /** * Insert a line before the class declaration in the given class code. * @@ -378,7 +511,7 @@ // Find the position of the comment block right before the class declaration $comment_pattern = '/\s*\*\/\s*$/m'; $insert_pos = null; - if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]); } @@ -386,7 +519,7 @@ { // Find the last empty line before the class declaration $empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/'; - if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]); } @@ -417,7 +550,9 @@ // Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines $patterns = [ "/defined\('_JEXEC'\)(.*?)\s*;/", + "/\\defined\('_JEXEC'\)(.*?)\s*;/", "/defined\('JPATH_BASE'\)(.*?)\s*;/", + "/\\defined\('JPATH_BASE'\)(.*?)\s*;/", ]; $insert_pos = null; diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md b/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md index 02ae935..9f90a93 100644 --- a/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md @@ -20,7 +20,7 @@ class Data #Gold { # Field $field # FieldName $fieldName # Filesfolders $filesFolders - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?Customcode $customcode = null, ...) + get(int $id = null) : object|array|null + exists(int $id = null) : bool @@ -41,7 +41,6 @@ note right of Data::__construct ?Field $field = null ?FieldName $fieldName = null ?Filesfolders $filesFolders = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php index 91e47db..a328bd7 100644 --- a/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php @@ -113,10 +113,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -129,14 +128,13 @@ class Data * @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) + ?Filesfolders $filesFolders = null) { $this->config = $config ?: Compiler::_('Config'); $this->customcode = $customcode ?: Compiler::_('Customcode'); @@ -146,7 +144,7 @@ class Data $this->field = $field ?: Compiler::_('Field'); $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/code.power b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.power index e230bc5..870060b 100644 --- a/src/766a9524-37df-4604-91a7-b98a6150ee26/code.power +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.power @@ -73,10 +73,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -89,14 +88,13 @@ * @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) + ?Filesfolders $filesFolders = null) { $this->config = $config ?: Compiler::_('Config'); $this->customcode = $customcode ?: Compiler::_('Customcode'); @@ -106,7 +104,7 @@ $this->field = $field ?: Compiler::_('Field'); $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php index 4e5292c..a215cdb 100644 --- a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php +++ b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php @@ -239,18 +239,16 @@ final class FieldsetXML implements Fieldsetinterface $dynamic_fields_xml = []; // set the custom table key $dbkey = 'g'; - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; - $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeBuildFields $this->event->trigger( 'jcb_ce_onBeforeBuildFields', - array(&$component_context, &$dynamic_fields_xml, &$read_only_xml, + [&$dynamic_fields_xml, &$read_only_xml, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -260,17 +258,16 @@ final class FieldsetXML implements Fieldsetinterface true ); } - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; + // Trigger Event: jcb_ce_onAfterBuildFields $this->event->trigger( 'jcb_ce_onAfterBuildFields', - array(&$component_context, &$dynamic_fields_xml, &$read_only_xml, + [&$dynamic_fields_xml, &$read_only_xml, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // set the default fields $main_xml = new \simpleXMLElement(''); $field_set_xml = $main_xml->addChild('fieldset'); diff --git a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power index b8ce66b..183e0c0 100644 --- a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power +++ b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power @@ -201,18 +201,16 @@ $dynamic_fields_xml = []; // set the custom table key $dbkey = 'g'; - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; - $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeBuildFields $this->event->trigger( 'jcb_ce_onBeforeBuildFields', - array(&$component_context, &$dynamic_fields_xml, &$read_only_xml, + [&$dynamic_fields_xml, &$read_only_xml, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -222,17 +220,16 @@ true ); } - // for plugin event TODO change event api signatures - $placeholders = $this->placeholder->active; + // Trigger Event: jcb_ce_onAfterBuildFields $this->event->trigger( 'jcb_ce_onAfterBuildFields', - array(&$component_context, &$dynamic_fields_xml, &$read_only_xml, + [&$dynamic_fields_xml, &$read_only_xml, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$placeholders, &$lang_view, - &$lang_views) + &$nameListCode, &$lang_view, + &$lang_views] ); - unset($placeholders); + // set the default fields $main_xml = new \simpleXMLElement(''); $field_set_xml = $main_xml->addChild('fieldset'); diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/README.md b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/README.md new file mode 100644 index 0000000..d848e58 --- /dev/null +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/README.md @@ -0,0 +1,91 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Header (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaThree** +```uml +@startuml +class Header << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Event $event + # Placeholder $placeholder + # Language $language + # UikitComp $uikitcomp + # AdminFilterType $adminfiltertype + # Category $category + # AccessSwitchList $accessswitchlist + # Filter $filter + # Tags $tags + # array $headers + + __construct(Config $config, Event $event, ...) + + get(string $context, string $codeName) : string + # getHeaders(string $context) : array + # setHelperClassHeader(array $headers, string $target_client) : void + # setChosenMultiSelectionHeaders(array $headers, string $nameListCode) : void +} + +note right of Header::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Event $event + Placeholder $placeholder + Language $language + UikitComp $uikitcomp + AdminFilterType $adminfiltertype + Category $category + AccessSwitchList $accessswitchlist + Filter $filter + Tags $tags +end note + +note right of Header::get + Get the headers for a file + + since: 3.2.0 + return: string +end note + +note right of Header::getHeaders + Get the headers for a file + + since: 3.2.0 + return: array +end note + +note right of Header::setHelperClassHeader + set Helper Dynamic Headers + + since: 3.2.0 + return: void +end note + +note right of Header::setChosenMultiSelectionHeaders + Build chosen multi selection headers for the view + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php new file mode 100644 index 0000000..855dcf5 --- /dev/null +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php @@ -0,0 +1,555 @@ + + * @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 VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; + + +/** + * Build headers for all Joomla 3 files + * + * @since 3.2.0 + */ +final class Header implements HeaderInterface +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // get static headers + $headers = $this->getHeaders($context); + + // get dynamic headers + switch ($context) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + case 'admin.views': + $this->setChosenMultiSelectionHeaders($headers, $codeName); + break; + + case 'admin.view.model': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'Html::addIncludePath(JPATH_COMPONENT.\'/helpers/html\');'; + $headers[] = 'Html::_(\'behavior.formvalidator\');'; + $headers[] = 'Html::_(\'formbehavior.chosen\', \'select\');'; + $headers[] = 'Html::_(\'behavior.keepalive\');'; + break; + + case 'admin.view.controller': + case 'site.admin.view.controller': + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'Html::_(\'behavior.multiselect\');'; + $headers[] = 'Html::_(\'dropdown.init\');'; + $headers[] = 'Html::_(\'formbehavior.chosen\', \'select\');'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + break; + + case 'dashboard.model': + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + case 'admin.views.model': + case 'ajax.admin.model': + case 'ajax.site.model': + case 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ListModel;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + break; + + case 'site.component': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'site.view': + case 'site.views': + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'form.custom.field': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = "jimport('joomla.form.helper');"; + $headers[] = "JFormHelper::loadFieldClass('###JFORM_extends###');"; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } + + /** + * Build chosen multi selection headers for the view + * + * @param array $headers The headers array + * @param string $nameListCode The list view name + * + * @return void + * @since 3.2.0 + */ + protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode) + { + // check that the filter type is the new filter option (2 = topbar) + if ($this->adminfiltertype->get($nameListCode, 1) == 2) + { + // add category switch + $add_category = false; + if ($this->category->exists("{$nameListCode}.extension") + && $this->category->get("{$nameListCode}.filter", 0) >= 1) + { + // is found so add it + $add_category = true; + } + // add accessLevels switch + $add_access_levels = false; + if ($this->accessswitchlist->exists($nameListCode)) + { + // is found so add it + $add_access_levels = true; + } + // check if this view have filters + if ($this->filter->exists($nameListCode)) + { + foreach ($this->filter->get($nameListCode) as $filter) + { + // we need this only for filters that are multi + if (isset($filter['multi']) && $filter['multi'] == 2) + { + // if this is a category we should make sure it must be added + if (!$add_category && $filter['type'] === 'category') + { + continue; + } + elseif ($add_category && $filter['type'] === 'category') + { + // already added here so no need to add again + $add_category = false; + } + // check if this was an access field + elseif ($filter['type'] === 'accesslevel') + { + // already added here so no need to add again + $add_access_levels = false; + } + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multiple' + . $filter['class'] + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + } + elseif ($add_category && $filter['type'] === 'category') + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + // already added here so no need to add again + $add_category = false; + } + } + } + // add category if not already added + if ($add_category) + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $this->category->exists("{$nameListCode}.name", 'error') + . '\') . \' -\']);'; + } + // add accessLevels if not already added + if ($add_access_levels) + { + // set the language strings for selection + $filter_name_select = 'Select Access'; + $filter_name_select_lang = $this->config->lang_prefix . '_FILTER_' + . StringHelper::safe( + $filter_name_select, 'U' + ); + // and to translation + $this->language->set( + $this->config->lang_target, $filter_name_select_lang, $filter_name_select + ); + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter_name_select_lang . '\') . \' -\']);'; + } + } + } +} + diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power new file mode 100644 index 0000000..0b60752 --- /dev/null +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power @@ -0,0 +1,517 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // get static headers + $headers = $this->getHeaders($context); + + // get dynamic headers + switch ($context) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + case 'admin.views': + $this->setChosenMultiSelectionHeaders($headers, $codeName); + break; + + case 'admin.view.model': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'Html::addIncludePath(JPATH_COMPONENT.\'/helpers/html\');'; + $headers[] = 'Html::_(\'behavior.formvalidator\');'; + $headers[] = 'Html::_(\'formbehavior.chosen\', \'select\');'; + $headers[] = 'Html::_(\'behavior.keepalive\');'; + break; + + case 'admin.view.controller': + case 'site.admin.view.controller': + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'Html::_(\'behavior.multiselect\');'; + $headers[] = 'Html::_(\'dropdown.init\');'; + $headers[] = 'Html::_(\'formbehavior.chosen\', \'select\');'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + break; + + case 'dashboard.model': + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + case 'admin.views.model': + case 'ajax.admin.model': + case 'ajax.site.model': + case 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ListModel;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + break; + + case 'site.component': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'site.view': + case 'site.views': + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'form.custom.field': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = "jimport('joomla.form.helper');"; + $headers[] = "JFormHelper::loadFieldClass('###JFORM_extends###');"; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } + + /** + * Build chosen multi selection headers for the view + * + * @param array $headers The headers array + * @param string $nameListCode The list view name + * + * @return void + * @since 3.2.0 + */ + protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode) + { + // check that the filter type is the new filter option (2 = topbar) + if ($this->adminfiltertype->get($nameListCode, 1) == 2) + { + // add category switch + $add_category = false; + if ($this->category->exists("{$nameListCode}.extension") + && $this->category->get("{$nameListCode}.filter", 0) >= 1) + { + // is found so add it + $add_category = true; + } + // add accessLevels switch + $add_access_levels = false; + if ($this->accessswitchlist->exists($nameListCode)) + { + // is found so add it + $add_access_levels = true; + } + // check if this view have filters + if ($this->filter->exists($nameListCode)) + { + foreach ($this->filter->get($nameListCode) as $filter) + { + // we need this only for filters that are multi + if (isset($filter['multi']) && $filter['multi'] == 2) + { + // if this is a category we should make sure it must be added + if (!$add_category && $filter['type'] === 'category') + { + continue; + } + elseif ($add_category && $filter['type'] === 'category') + { + // already added here so no need to add again + $add_category = false; + } + // check if this was an access field + elseif ($filter['type'] === 'accesslevel') + { + // already added here so no need to add again + $add_access_levels = false; + } + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multiple' + . $filter['class'] + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + } + elseif ($add_category && $filter['type'] === 'category') + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter['lang_select'] . '\') . \' -\']);'; + // already added here so no need to add again + $add_category = false; + } + } + } + // add category if not already added + if ($add_category) + { + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleCategories' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $this->category->exists("{$nameListCode}.name", 'error') + . '\') . \' -\']);'; + } + // add accessLevels if not already added + if ($add_access_levels) + { + // set the language strings for selection + $filter_name_select = 'Select Access'; + $filter_name_select_lang = $this->config->lang_prefix . '_FILTER_' + . StringHelper::safe( + $filter_name_select, 'U' + ); + // and to translation + $this->language->set( + $this->config->lang_target, $filter_name_select_lang, $filter_name_select + ); + // add the header + $headers[] + = 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels' + . '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\'' + . $filter_name_select_lang . '\') . \' -\']);'; + } + } + } \ No newline at end of file diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json new file mode 100644 index 0000000..8c2e22e --- /dev/null +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "7b56a097-9979-477b-b18a-c9dfc2f1e13b", + "implements": [ + "3a777d70-52ad-49ec-9016-6f7438608613" + ], + "load_selection": null, + "name": "Header", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaThree.Header", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection2": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection3": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection4": { + "use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d", + "as": "default" + }, + "use_selection5": { + "use": "9481caa2-6d04-4598-8320-543a93927243", + "as": "default" + }, + "use_selection6": { + "use": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection7": { + "use": "81212121-ad5c-43c5-b046-f2650864f690", + "as": "default" + }, + "use_selection8": { + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "as": "default" + }, + "use_selection9": { + "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "as": "default" + }, + "use_selection10": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection11": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaThree.Header", + "description": "Build headers for all Joomla 3 files\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/84c11075-570a-4907-9be0-9305e0fabe3c/README.md b/src/84c11075-570a-4907-9be0-9305e0fabe3c/README.md new file mode 100644 index 0000000..70ada2f --- /dev/null +++ b/src/84c11075-570a-4907-9be0-9305e0fabe3c/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsUikit (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsUikit << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # ConfigFieldsets $configfieldsets + # ExtensionsParams $extensionsparams + # Customfield $customfield + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsUikit::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + ConfigFieldsets $configfieldsets + ExtensionsParams $extensionsparams + Customfield $customfield +end note + +note right of ConfigFieldsetsUikit::set + Set Uikit Config Fieldsets + + 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/84c11075-570a-4907-9be0-9305e0fabe3c/code.php b/src/84c11075-570a-4907-9be0-9305e0fabe3c/code.php new file mode 100644 index 0000000..e67c8a3 --- /dev/null +++ b/src/84c11075-570a-4907-9be0-9305e0fabe3c/code.php @@ -0,0 +1,367 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; + + +/** + * Config Fieldsets Uikit Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsUikit +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Uikit Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->config->uikit > 0) + { + // main lang prefix + $lang = $lang . ''; + // start building field set for uikit functions + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="uikit_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_UIKIT_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_UIKIT_DESC">'); + // set tab lang + if (1 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', "Uikit2 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit
https://getuikit.com/v2/" + ); + } + elseif (2 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', + "Uikit2 and Uikit3 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit version 2 or version 3" + ); + } + elseif (3 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', "Uikit3 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit https://getuikit.com/" + ); + } + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_JQUERY_LOAD_LABEL', "Load Joomla jQuery" + ); + $this->language->set( + $this->config->lang_target, $lang . '_JQUERY_LOAD_DESC', + "Would you like to load the Joomla jQuery Framework?" + ); + $this->language->set($this->config->lang_target, $lang . '_JQUERY_LOAD', "Load jQuery"); + $this->language->set($this->config->lang_target, $lang . '_JQUERY_REMOVE', "Remove jQuery"); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_JQUERY_LOAD_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_JQUERY_LOAD_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"add_jquery_framework":"1"'); + + // add version selection + if (2 == $this->config->uikit) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_VERSION_LABEL', + "Uikit Versions" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_VERSION_DESC', + "Select what version you would like to use" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_V2', "Version 2" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_V3', "Version 3" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_VERSION_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_UIKIT_VERSION_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="2">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_version":"2"'); + } + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LOAD_LABEL', "Loading Options" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LOAD_DESC', + "Set the uikit loading option." + ); + $this->language->set($this->config->lang_target, $lang . '_AUTO_LOAD', "Auto"); + $this->language->set($this->config->lang_target, $lang . '_FORCE_LOAD', "Force"); + $this->language->set($this->config->lang_target, $lang . '_DONT_LOAD', "Not"); + $this->language->set( + $this->config->lang_target, $lang . '_ONLY_EXTRA', "Only Extra" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_LOAD_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_UIKIT_LOAD_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + if (2 == $this->config->uikit || 1 == $this->config->uikit) + { + $this->configfieldsets->add('component', Indent::_(3) . '"'); + } + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_load":"1"'); + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_MIN_LABEL', "Load Minified" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_MIN_DESC', + "Should the minified version of uikit files be loaded?" + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + // set the field + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_MIN_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_UIKIT_MIN_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_min":""'); + + if (2 == $this->config->uikit || 1 == $this->config->uikit) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_STYLE_LABEL', "css Style" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_STYLE_DESC', + "Set the css style that should be used." + ); + $this->language->set( + $this->config->lang_target, $lang . '_FLAT_LOAD', "Flat" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ALMOST_FLAT_LOAD', "Almost Flat" + ); + $this->language->set( + $this->config->lang_target, $lang . '_GRADIANT_LOAD', "Gradient" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_STYLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_UIKIT_STYLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + if (2 == $this->config->uikit) + { + $this->configfieldsets->add('component', Indent::_(3) + . 'showon="uikit_version:2"'); + } + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) + . '"'); + $this->configfieldsets->add('component', Indent::_(3) + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_style":""'); + } + // add custom Uikit Settings fields + if ($this->customfield->isArray('Uikit Settings')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Uikit Settings') + )); + $this->customfield->remove('Uikit Settings'); + } + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } +} + diff --git a/src/84c11075-570a-4907-9be0-9305e0fabe3c/code.power b/src/84c11075-570a-4907-9be0-9305e0fabe3c/code.power new file mode 100644 index 0000000..d4a60b8 --- /dev/null +++ b/src/84c11075-570a-4907-9be0-9305e0fabe3c/code.power @@ -0,0 +1,335 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Uikit Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->config->uikit > 0) + { + // main lang prefix + $lang = $lang . ''; + // start building field set for uikit functions + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="uikit_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_UIKIT_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_UIKIT_DESC">'); + // set tab lang + if (1 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', "Uikit2 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit https://getuikit.com/v2/" + ); + } + elseif (2 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', + "Uikit2 and Uikit3 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit version 2 or version 3" + ); + } + elseif (3 == $this->config->uikit) + { + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LABEL', "Uikit3 Settings" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit https://getuikit.com/" + ); + } + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_JQUERY_LOAD_LABEL', "Load Joomla jQuery" + ); + $this->language->set( + $this->config->lang_target, $lang . '_JQUERY_LOAD_DESC', + "Would you like to load the Joomla jQuery Framework?" + ); + $this->language->set($this->config->lang_target, $lang . '_JQUERY_LOAD', "Load jQuery"); + $this->language->set($this->config->lang_target, $lang . '_JQUERY_REMOVE', "Remove jQuery"); + + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_JQUERY_LOAD_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_JQUERY_LOAD_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"add_jquery_framework":"1"'); + + // add version selection + if (2 == $this->config->uikit) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_VERSION_LABEL', + "Uikit Versions" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_VERSION_DESC', + "Select what version you would like to use" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_V2', "Version 2" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_V3', "Version 3" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_VERSION_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_UIKIT_VERSION_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="2">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_version":"2"'); + } + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LOAD_LABEL', "Loading Options" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_LOAD_DESC', + "Set the uikit loading option." + ); + $this->language->set($this->config->lang_target, $lang . '_AUTO_LOAD', "Auto"); + $this->language->set($this->config->lang_target, $lang . '_FORCE_LOAD', "Force"); + $this->language->set($this->config->lang_target, $lang . '_DONT_LOAD', "Not"); + $this->language->set( + $this->config->lang_target, $lang . '_ONLY_EXTRA', "Only Extra" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_LOAD_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_UIKIT_LOAD_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + if (2 == $this->config->uikit || 1 == $this->config->uikit) + { + $this->configfieldsets->add('component', Indent::_(3) . '"'); + } + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_load":"1"'); + + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_MIN_LABEL', "Load Minified" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_MIN_DESC', + "Should the minified version of uikit files be loaded?" + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + // set the field + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_MIN_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang + . '_UIKIT_MIN_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_min":""'); + + if (2 == $this->config->uikit || 1 == $this->config->uikit) + { + // set field lang + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_STYLE_LABEL', "css Style" + ); + $this->language->set( + $this->config->lang_target, $lang . '_UIKIT_STYLE_DESC', + "Set the css style that should be used." + ); + $this->language->set( + $this->config->lang_target, $lang . '_FLAT_LOAD', "Flat" + ); + $this->language->set( + $this->config->lang_target, $lang . '_ALMOST_FLAT_LOAD', "Almost Flat" + ); + $this->language->set( + $this->config->lang_target, $lang . '_GRADIANT_LOAD', "Gradient" + ); + // set the field + $this->configfieldsets->add('component', Indent::_(2) + . 'configfieldsets->add('component', Indent::_(3) . 'type="radio"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang + . '_UIKIT_STYLE_LABEL"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_UIKIT_STYLE_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) + . 'class="btn-group btn-group-yesno"'); + if (2 == $this->config->uikit) + { + $this->configfieldsets->add('component', Indent::_(3) + . 'showon="uikit_version:2"'); + } + $this->configfieldsets->add('component', Indent::_(3) . 'default="">'); + $this->configfieldsets->add('component', Indent::_(3) . ''); + $this->configfieldsets->add('component', Indent::_(3) . '"'); + $this->configfieldsets->add('component', Indent::_(3) + . '"'); + $this->configfieldsets->add('component', Indent::_(3) + . '"'); + $this->configfieldsets->add('component', Indent::_(2) . ""); + // set params defaults + $this->extensionsparams->add('component', '"uikit_style":""'); + } + // add custom Uikit Settings fields + if ($this->customfield->isArray('Uikit Settings')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Uikit Settings') + )); + $this->customfield->remove('Uikit Settings'); + } + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } \ No newline at end of file diff --git a/src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json b/src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json new file mode 100644 index 0000000..f0d4e8c --- /dev/null +++ b/src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json @@ -0,0 +1,47 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "84c11075-570a-4907-9be0-9305e0fabe3c", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsUikit", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsUikit", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection3": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection4": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsUikit", + "description": "Config Fieldsets Uikit Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md index 7d9cb05..278c983 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md @@ -13,8 +13,8 @@ class History #Gold { # ?object $tmp # Config $config - # \JDatabaseDriver $db - + __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + # $db + + __construct(?Config $config = null) + get(string $type, int $id) : ?object # set(object $object, int $action) : bool } diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php index 2cfe3f8..6912978 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php @@ -46,23 +46,21 @@ class History implements HistoryInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 */ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param Config|null $config The compiler config object. - * @param \JDatabaseDriver|null $db The Database Driver object. + * @param Config|null $config The compiler config object. * * @since 3.2.0 */ - public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + public function __construct(?Config $config = null) { $this->config = $config ?: Compiler::_('Config'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.power b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.power index 3aa1539..c6c86cd 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.power +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.power @@ -17,23 +17,21 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 */ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param Config|null $config The compiler config object. - * @param \JDatabaseDriver|null $db The Database Driver object. + * @param Config|null $config The compiler config object. * * @since 3.2.0 */ - public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + public function __construct(?Config $config = null) { $this->config = $config ?: Compiler::_('Config'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md index 4518abe..76ac58b 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md @@ -11,15 +11,18 @@ ```uml @startuml class Component #Gold { + # $targetVersion + register(Container $container) : void - + getComponent(Container $container) : CompilerComponent - + getSettings(Container $container) : Settings + + getCompilerComponent(Container $container) : CompilerComponent + + getJ3Settings(Container $container) : J3Settings + + getJ4Settings(Container $container) : J4Settings + getDashboard(Container $container) : Dashboard + getPlaceholder(Container $container) : Placeholder + getData(Container $container) : Data + getStructure(Container $container) : Structure + getStructuresingle(Container $container) : Structuresingle + getStructuremultiple(Container $container) : Structuremultiple + + getSettings(Container $container) : Settings } note right of Component::register @@ -29,61 +32,75 @@ note right of Component::register return: void end note -note left of Component::getComponent - Get the Component +note left of Component::getCompilerComponent + Get The Component Class. since: 3.2.0 return: CompilerComponent end note -note right of Component::getSettings - Get the Compiler Component (version) Settings +note right of Component::getJ3Settings + Get The Settings Class. since: 3.2.0 - return: Settings + return: J3Settings end note -note left of Component::getDashboard - Get the Compiler Component Dynamic Dashboard +note left of Component::getJ4Settings + Get The Settings Class. + + since: 3.2.0 + return: J4Settings +end note + +note right of Component::getDashboard + Get The Dashboard Class. since: 3.2.0 return: Dashboard end note -note right of Component::getPlaceholder - Get the Component Placeholders +note left of Component::getPlaceholder + Get The Placeholder Class. since: 3.2.0 return: Placeholder end note -note left of Component::getData - Get the Component Data +note right of Component::getData + Get The Data Class. since: 3.2.0 return: Data end note -note right of Component::getStructure - Get the Compiler Structure +note left of Component::getStructure + Get The Structure Class. since: 3.2.0 return: Structure end note -note left of Component::getStructuresingle - Get the Compiler Structure Single +note right of Component::getStructuresingle + Get The Structuresingle Class. since: 3.2.0 return: Structuresingle end note -note right of Component::getStructuremultiple - Get the Compiler Structure Multiple +note left of Component::getStructuremultiple + Get The Structuremultiple Class. since: 3.2.0 return: Structuremultiple end note + +note right of Component::getSettings + Get The Settings Class. + + since: 3.2.0 + return: Settings +end note @enduml ``` diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php index b6e9b67..76d79d6 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php @@ -15,13 +15,15 @@ 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\JoomlaThree\Settings as J3Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings; 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; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; /** @@ -31,6 +33,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; */ class Component implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -42,10 +52,13 @@ class Component implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerComponent::class, 'Component') - ->share('Component', [$this, 'getComponent'], true); + ->share('Component', [$this, 'getCompilerComponent'], true); - $container->alias(Settings::class, 'Component.Settings') - ->share('Component.Settings', [$this, 'getSettings'], true); + $container->alias(J3Settings::class, 'Component.J3.Settings') + ->share('Component.J3.Settings', [$this, 'getJ3Settings'], true); + + $container->alias(J4Settings::class, 'Component.J4.Settings') + ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -64,17 +77,20 @@ class Component implements ServiceProviderInterface $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); + + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); } /** - * Get the Component + * Get The Component Class. * * @param Container $container The DI container. * * @return CompilerComponent * @since 3.2.0 */ - public function getComponent(Container $container): CompilerComponent + public function getCompilerComponent(Container $container): CompilerComponent { return new CompilerComponent( $container->get('Component.Data') @@ -82,16 +98,16 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component (version) Settings + * Get The Settings Class. * * @param Container $container The DI container. * - * @return Settings + * @return J3Settings * @since 3.2.0 */ - public function getSettings(Container $container): Settings + public function getJ3Settings(Container $container): J3Settings { - return new Settings( + return new J3Settings( $container->get('Config'), $container->get('Registry'), $container->get('Event'), @@ -104,7 +120,29 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component Dynamic Dashboard + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J4Settings + * @since 3.2.0 + */ + public function getJ4Settings(Container $container): J4Settings + { + return new J4Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get The Dashboard Class. * * @param Container $container The DI container. * @@ -120,7 +158,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Placeholders + * Get The Placeholder Class. * * @param Container $container The DI container. * @@ -135,7 +173,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -169,7 +207,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure + * Get The Structure Class. * * @param Container $container The DI container. * @@ -186,7 +224,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Single + * Get The Structuresingle Class. * * @param Container $container The DI container. * @@ -198,6 +236,7 @@ class Component implements ServiceProviderInterface return new Structuresingle( $container->get('Config'), $container->get('Registry'), + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Component'), $container->get('Compiler.Builder.Content.One'), @@ -208,7 +247,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Multiple + * Get The Structuremultiple Class. * * @param Container $container The DI container. * @@ -227,6 +266,23 @@ class Component implements ServiceProviderInterface $container->get('Utilities.Structure') ); } - + + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Component.J' . $this->targetVersion . '.Settings'); + } } diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power index 22ef1cb..b4214e3 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power @@ -1,3 +1,11 @@ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -9,10 +17,13 @@ public function register(Container $container) { $container->alias(CompilerComponent::class, 'Component') - ->share('Component', [$this, 'getComponent'], true); + ->share('Component', [$this, 'getCompilerComponent'], true); - $container->alias(Settings::class, 'Component.Settings') - ->share('Component.Settings', [$this, 'getSettings'], true); + $container->alias(J3Settings::class, 'Component.J3.Settings') + ->share('Component.J3.Settings', [$this, 'getJ3Settings'], true); + + $container->alias(J4Settings::class, 'Component.J4.Settings') + ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -31,17 +42,20 @@ $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); + + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); } /** - * Get the Component + * Get The Component Class. * * @param Container $container The DI container. * * @return CompilerComponent * @since 3.2.0 */ - public function getComponent(Container $container): CompilerComponent + public function getCompilerComponent(Container $container): CompilerComponent { return new CompilerComponent( $container->get('Component.Data') @@ -49,16 +63,16 @@ } /** - * Get the Compiler Component (version) Settings + * Get The Settings Class. * * @param Container $container The DI container. * - * @return Settings + * @return J3Settings * @since 3.2.0 */ - public function getSettings(Container $container): Settings + public function getJ3Settings(Container $container): J3Settings { - return new Settings( + return new J3Settings( $container->get('Config'), $container->get('Registry'), $container->get('Event'), @@ -71,7 +85,29 @@ } /** - * Get the Compiler Component Dynamic Dashboard + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J4Settings + * @since 3.2.0 + */ + public function getJ4Settings(Container $container): J4Settings + { + return new J4Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get The Dashboard Class. * * @param Container $container The DI container. * @@ -87,7 +123,7 @@ } /** - * Get the Component Placeholders + * Get The Placeholder Class. * * @param Container $container The DI container. * @@ -102,7 +138,7 @@ } /** - * Get the Component Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -136,7 +172,7 @@ } /** - * Get the Compiler Structure + * Get The Structure Class. * * @param Container $container The DI container. * @@ -153,7 +189,7 @@ } /** - * Get the Compiler Structure Single + * Get The Structuresingle Class. * * @param Container $container The DI container. * @@ -165,6 +201,7 @@ return new Structuresingle( $container->get('Config'), $container->get('Registry'), + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Component'), $container->get('Compiler.Builder.Content.One'), @@ -175,7 +212,7 @@ } /** - * Get the Compiler Structure Multiple + * Get The Structuremultiple Class. * * @param Container $container The DI container. * @@ -194,3 +231,21 @@ $container->get('Utilities.Structure') ); } + + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Component.J' . $this->targetVersion . '.Settings'); + } \ No newline at end of file diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json index 8da4ed9..00849c5 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json @@ -18,31 +18,39 @@ }, "use_selection1": { "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", - "as": "default" + "as": "J3Settings" }, "use_selection2": { + "use": "e7fff971-b031-42bf-8009-ef554e30854d", + "as": "J4Settings" + }, + "use_selection3": { "use": "cfe62a32-8818-4bfb-8751-2f1e109b5336", "as": "default" }, - "use_selection3": { + "use_selection4": { "use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", "as": "default" }, - "use_selection4": { + "use_selection5": { "use": "ef9578e5-4c9d-46bf-866f-3a94bdc7b753", "as": "default" }, - "use_selection5": { + "use_selection6": { "use": "6c89c663-78f5-4078-9fac-7047f2eaaf96", "as": "default" }, - "use_selection6": { + "use_selection7": { "use": "673954d3-78d3-445a-b99f-4b40d617c882", "as": "default" }, - "use_selection7": { + "use_selection8": { "use": "b69a23db-0a62-4840-a9c5-b2d8d63ecc6c", "as": "default" + }, + "use_selection9": { + "use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "as": "Settings" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Component", diff --git a/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/README.md b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/README.md new file mode 100644 index 0000000..7543c71 --- /dev/null +++ b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/README.md @@ -0,0 +1,59 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CustomButtonPermissions (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class CustomButtonPermissions << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # PermissionComponent $permissioncomponent + # Counter $counter + + __construct(Config $config, Language $language, ...) + + add(object $settings, string $nameView, ...) : void +} + +note right of CustomButtonPermissions::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + PermissionComponent $permissioncomponent + Counter $counter +end note + +note right of CustomButtonPermissions::add + Add Custom Button Permissions + + since: 3.2.0 + return: void + + arguments: + object $settings + string $nameView + string $code +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php new file mode 100644 index 0000000..5458913 --- /dev/null +++ b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php @@ -0,0 +1,141 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Custom Button Permissions Creator Class + * + * @since 3.2.0 + */ +final class CustomButtonPermissions +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The PermissionComponent Class. + * + * @var PermissionComponent + * @since 3.2.0 + */ + protected PermissionComponent $permissioncomponent; + + /** + * The Counter Class. + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param PermissionComponent $permissioncomponent The PermissionComponent Class. + * @param Counter $counter The Counter Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + PermissionComponent $permissioncomponent, + Counter $counter) + { + $this->config = $config; + $this->language = $language; + $this->permissioncomponent = $permissioncomponent; + $this->counter = $counter; + } + + /** + * Add Custom Button Permissions + * + * @param object $settings The view settings + * @param string $nameView The view name + * @param string $code The view code name. + * + * @since 3.2.0 + */ + public function add(object $settings, string $nameView, string $code): void + { + // add the custom permissions to use the buttons of this view + if (isset($settings->custom_buttons) + && ArrayHelper::check($settings->custom_buttons)) + { + foreach ($settings->custom_buttons as $custom_buttons) + { + $customButtonName = $custom_buttons['name']; + $customButtonCode = StringHelper::safe( + $customButtonName + ); + $customButtonTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ); + $customButtonDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ) . '_DESC'; + $sortButtonKey = StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access' + ); + + $this->language->set( + 'bothadmin', $customButtonTitle, + $nameView . ' ' . $customButtonName . ' Button Access' + ); + + $this->language->set( + 'bothadmin', $customButtonDesc, + ' Allows the users in this group to access the ' + . StringHelper::safe($customButtonName, 'w') + . ' button.' + ); + + $this->permissioncomponent->set($sortButtonKey, [ + 'name' => "$code.$customButtonCode", + 'title' => $customButtonTitle, + 'description' => $customButtonDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + } + } + } +} + diff --git a/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.power b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.power new file mode 100644 index 0000000..92af8ba --- /dev/null +++ b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.power @@ -0,0 +1,110 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The PermissionComponent Class. + * + * @var PermissionComponent + * @since 3.2.0 + */ + protected PermissionComponent $permissioncomponent; + + /** + * The Counter Class. + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param PermissionComponent $permissioncomponent The PermissionComponent Class. + * @param Counter $counter The Counter Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + PermissionComponent $permissioncomponent, + Counter $counter) + { + $this->config = $config; + $this->language = $language; + $this->permissioncomponent = $permissioncomponent; + $this->counter = $counter; + } + + /** + * Add Custom Button Permissions + * + * @param object $settings The view settings + * @param string $nameView The view name + * @param string $code The view code name. + * + * @since 3.2.0 + */ + public function add(object $settings, string $nameView, string $code): void + { + // add the custom permissions to use the buttons of this view + if (isset($settings->custom_buttons) + && ArrayHelper::check($settings->custom_buttons)) + { + foreach ($settings->custom_buttons as $custom_buttons) + { + $customButtonName = $custom_buttons['name']; + $customButtonCode = StringHelper::safe( + $customButtonName + ); + $customButtonTitle = $this->config->lang_prefix . '_' + . StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ); + $customButtonDesc = $this->config->lang_prefix . '_' + . StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ) . '_DESC'; + $sortButtonKey = StringHelper::safe( + $nameView . ' ' . $customButtonName . ' Button Access' + ); + + $this->language->set( + 'bothadmin', $customButtonTitle, + $nameView . ' ' . $customButtonName . ' Button Access' + ); + + $this->language->set( + 'bothadmin', $customButtonDesc, + ' Allows the users in this group to access the ' + . StringHelper::safe($customButtonName, 'w') + . ' button.' + ); + + $this->permissioncomponent->set($sortButtonKey, [ + 'name' => "$code.$customButtonCode", + 'title' => $customButtonTitle, + 'description' => $customButtonDesc + ]); + + // the size needs increase + $this->counter->accessSize++; + } + } + } \ No newline at end of file diff --git a/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json new file mode 100644 index 0000000..8594ce0 --- /dev/null +++ b/src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json @@ -0,0 +1,43 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "8bf026e7-9ae0-423c-b74b-5bc16c54acf7", + "implements": null, + "load_selection": null, + "name": "CustomButtonPermissions", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.CustomButtonPermissions", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "94f4939f-82cc-4196-802b-1346ce5c7f99", + "as": "default" + }, + "use_selection3": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "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.Creator.CustomButtonPermissions", + "description": "Custom Button Permissions Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/README.md b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/README.md new file mode 100644 index 0000000..5fad958 --- /dev/null +++ b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AllowEdit (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller** +```uml +@startuml +class AllowEdit << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + # Dispenser $dispenser + # Category $category + # CategoryOtherName $categoryothername + + __construct(Config $config, Permission $permission, ...) + + get(string $nameSingleCode, string $nameListCode) : string +} + +note right of AllowEdit::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Permission $permission + Dispenser $dispenser + Category $category + CategoryOtherName $categoryothername +end note + +note right of AllowEdit::get + Get Allow Edit Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php new file mode 100644 index 0000000..b41909b --- /dev/null +++ b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php @@ -0,0 +1,300 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; + + +/** + * Controller Allow Edit Class for Joomla 3 + * + * @since 3.2.0 + */ +final class AllowEdit implements AllowEditInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.power b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.power new file mode 100644 index 0000000..73405eb --- /dev/null +++ b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.power @@ -0,0 +1,267 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json new file mode 100644 index 0000000..54dc519 --- /dev/null +++ b/src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "8faaed82-522d-4f78-bd43-0ab3f7c72e5f", + "implements": [ + "992a842f-1ba9-4a5c-b214-042459ffe038" + ], + "load_selection": null, + "name": "AllowEdit", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J3.Controller.AllowEdit", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection3": { + "use": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection4": { + "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaThree.Controller.AllowEdit", + "description": "Controller Allow Edit Class for Joomla 3\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md index 27d1288..072ee00 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md @@ -12,11 +12,25 @@ @startuml class Creator #Gold { + register(Container $container) : void + + getAccessSections(Container $container) : AccessSections + + getAccessSectionsCategory(Container $container) : AccessSectionsCategory + + getAccessSectionsJoomlaFields(Container $container) : AccessSectionsJoomlaFields + getBuilders(Container $container) : Builders + getCustomFieldTypeFile(Container $container) : CustomFieldTypeFile + + getCustomButtonPermissions(Container $container) : CustomButtonPermissions + + getConfigFieldsets(Container $container) : ConfigFieldsets + + getConfigFieldsetsCustomfield(Container $container) : ConfigFieldsetsCustomfield + + getConfigFieldsetsEmailHelper(Container $container) : ConfigFieldsetsEmailHelper + + getConfigFieldsetsEncryption(Container $container) : ConfigFieldsetsEncryption + + getConfigFieldsetsGlobal(Container $container) : ConfigFieldsetsGlobal + + getConfigFieldsetsGooglechart(Container $container) : ConfigFieldsetsGooglechart + + getConfigFieldsetsGroupControl(Container $container) : ConfigFieldsetsGroupControl + + getConfigFieldsetsSiteControl(Container $container) : ConfigFieldsetsSiteControl + + getConfigFieldsetsUikit(Container $container) : ConfigFieldsetsUikit + getLayout(Container $container) : Layout + getPermission(Container $container) : Permission + getSiteFieldData(Container $container) : SiteFieldData + + getRequest(Container $container) : Request + getFieldsetString(Container $container) : FieldsetString + getFieldsetXML(Container $container) : FieldsetXML + getFieldsetDynamic(Container $container) : FieldsetDynamic @@ -35,41 +49,139 @@ note right of Creator::register return: void end note -note left of Creator::getBuilders +note left of Creator::getAccessSections + Get The AccessSections Class. + + since: 3.2.0 + return: AccessSections +end note + +note right of Creator::getAccessSectionsCategory + Get The AccessSectionsCategory Class. + + since: 3.2.0 + return: AccessSectionsCategory +end note + +note left of Creator::getAccessSectionsJoomlaFields + Get The AccessSectionsJoomlaFields Class. + + since: 3.2.0 + return: AccessSectionsJoomlaFields +end note + +note right of Creator::getBuilders Get The Builders Class. since: 3.2.0 return: Builders end note -note right of Creator::getCustomFieldTypeFile +note left of Creator::getCustomFieldTypeFile Get The CustomFieldTypeFile Class. since: 3.2.0 return: CustomFieldTypeFile end note -note left of Creator::getLayout +note right of Creator::getCustomButtonPermissions + Get The CustomButtonPermissions Class. + + since: 3.2.0 + return: CustomButtonPermissions +end note + +note left of Creator::getConfigFieldsets + Get The ConfigFieldsets Class. + + since: 3.2.0 + return: ConfigFieldsets +end note + +note right of Creator::getConfigFieldsetsCustomfield + Get The ConfigFieldsetsCustomfield Class. + + since: 3.2.0 + return: ConfigFieldsetsCustomfield +end note + +note left of Creator::getConfigFieldsetsEmailHelper + Get The ConfigFieldsetsEmailHelper Class. + + since: 3.2.0 + return: ConfigFieldsetsEmailHelper +end note + +note right of Creator::getConfigFieldsetsEncryption + Get The ConfigFieldsetsEncryption Class. + + since: 3.2.0 + return: ConfigFieldsetsEncryption +end note + +note left of Creator::getConfigFieldsetsGlobal + Get The ConfigFieldsetsGlobal Class. + + since: 3.2.0 + return: ConfigFieldsetsGlobal +end note + +note right of Creator::getConfigFieldsetsGooglechart + Get The ConfigFieldsetsGooglechart Class. + + since: 3.2.0 + return: ConfigFieldsetsGooglechart +end note + +note left of Creator::getConfigFieldsetsGroupControl + Get The ConfigFieldsetsGroupControl Class. + + since: 3.2.0 + return: ConfigFieldsetsGroupControl +end note + +note right of Creator::getConfigFieldsetsSiteControl + Get The ConfigFieldsetsSiteControl Class. + + since: 3.2.0 + return: ConfigFieldsetsSiteControl +end note + +note left of Creator::getConfigFieldsetsUikit + Get The ConfigFieldsetsUikit Class. + + since: 3.2.0 + return: ConfigFieldsetsUikit +end note + +note right of Creator::getLayout Get The Layout Class. since: 3.2.0 return: Layout end note -note right of Creator::getPermission +note left of Creator::getPermission Get The Permission Class. since: 3.2.0 return: Permission end note -note left of Creator::getSiteFieldData +note right of Creator::getSiteFieldData Get The SiteFieldData Class. since: 3.2.0 return: SiteFieldData end note +note left of Creator::getRequest + Get The Request Class. + + since: 3.2.0 + return: Request +end note + note right of Creator::getFieldsetString Get The FieldsetString Class. diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php index 67b7437..41bee7a 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php @@ -14,11 +14,25 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSections; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsCategory; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsJoomlaFields; use VDM\Joomla\Componentbuilder\Compiler\Creator\Builders; use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomFieldTypeFile; +use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsSiteControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsUikit; use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout; use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; use VDM\Joomla\Componentbuilder\Compiler\Creator\SiteFieldData; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Request; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetString; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetXML; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetDynamic; @@ -47,12 +61,51 @@ class Creator implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(AccessSections::class, 'Compiler.Creator.Access.Sections') + ->share('Compiler.Creator.Access.Sections', [$this, 'getAccessSections'], true); + + $container->alias(AccessSectionsCategory::class, 'Compiler.Creator.Access.Sections.Category') + ->share('Compiler.Creator.Access.Sections.Category', [$this, 'getAccessSectionsCategory'], true); + + $container->alias(AccessSectionsJoomlaFields::class, 'Compiler.Creator.Access.Sections.Joomla.Fields') + ->share('Compiler.Creator.Access.Sections.Joomla.Fields', [$this, 'getAccessSectionsJoomlaFields'], true); + $container->alias(Builders::class, 'Compiler.Creator.Builders') ->share('Compiler.Creator.Builders', [$this, 'getBuilders'], true); $container->alias(CustomFieldTypeFile::class, 'Compiler.Creator.Custom.Field.Type.File') ->share('Compiler.Creator.Custom.Field.Type.File', [$this, 'getCustomFieldTypeFile'], true); + $container->alias(CustomButtonPermissions::class, 'Compiler.Creator.Custom.Button.Permissions') + ->share('Compiler.Creator.Custom.Button.Permissions', [$this, 'getCustomButtonPermissions'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Creator.Config.Fieldsets') + ->share('Compiler.Creator.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Creator.Config.Fieldsets.Customfield') + ->share('Compiler.Creator.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ConfigFieldsetsEmailHelper::class, 'Compiler.Creator.Config.Fieldsets.Email.Helper') + ->share('Compiler.Creator.Config.Fieldsets.Email.Helper', [$this, 'getConfigFieldsetsEmailHelper'], true); + + $container->alias(ConfigFieldsetsEncryption::class, 'Compiler.Creator.Config.Fieldsets.Encryption') + ->share('Compiler.Creator.Config.Fieldsets.Encryption', [$this, 'getConfigFieldsetsEncryption'], true); + + $container->alias(ConfigFieldsetsGlobal::class, 'Compiler.Creator.Config.Fieldsets.Global') + ->share('Compiler.Creator.Config.Fieldsets.Global', [$this, 'getConfigFieldsetsGlobal'], true); + + $container->alias(ConfigFieldsetsGooglechart::class, 'Compiler.Creator.Config.Fieldsets.Googlechart') + ->share('Compiler.Creator.Config.Fieldsets.Googlechart', [$this, 'getConfigFieldsetsGooglechart'], true); + + $container->alias(ConfigFieldsetsGroupControl::class, 'Compiler.Creator.Config.Fieldsets.Group.Control') + ->share('Compiler.Creator.Config.Fieldsets.Group.Control', [$this, 'getConfigFieldsetsGroupControl'], true); + + $container->alias(ConfigFieldsetsSiteControl::class, 'Compiler.Creator.Config.Fieldsets.Site.Control') + ->share('Compiler.Creator.Config.Fieldsets.Site.Control', [$this, 'getConfigFieldsetsSiteControl'], true); + + $container->alias(ConfigFieldsetsUikit::class, 'Compiler.Creator.Config.Fieldsets.Uikit') + ->share('Compiler.Creator.Config.Fieldsets.Uikit', [$this, 'getConfigFieldsetsUikit'], true); + $container->alias(Layout::class, 'Compiler.Creator.Layout') ->share('Compiler.Creator.Layout', [$this, 'getLayout'], true); @@ -62,6 +115,9 @@ class Creator implements ServiceProviderInterface $container->alias(SiteFieldData::class, 'Compiler.Creator.Site.Field.Data') ->share('Compiler.Creator.Site.Field.Data', [$this, 'getSiteFieldData'], true); + $container->alias(Request::class, 'Compiler.Creator.Request') + ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -90,6 +146,62 @@ class Creator implements ServiceProviderInterface ->share('Compiler.Creator.Fieldset', [$this, 'getFieldset'], true); } + /** + * Get The AccessSections Class. + * + * @param Container $container The DI container. + * + * @return AccessSections + * @since 3.2.0 + */ + public function getAccessSections(Container $container): AccessSections + { + return new AccessSections( + $container->get('Config'), + $container->get('Event'), + $container->get('Language'), + $container->get('Component'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Utilities.Counter'), + $container->get('Compiler.Creator.Permission'), + $container->get('Compiler.Builder.Assets.Rules'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Compiler.Builder.Permission.Views'), + $container->get('Compiler.Builder.Permission.Fields'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Compiler.Creator.Custom.Button.Permissions') + ); + } + + /** + * Get The AccessSectionsCategory Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsCategory + * @since 3.2.0 + */ + public function getAccessSectionsCategory(Container $container): AccessSectionsCategory + { + return new AccessSectionsCategory( + $container->get('Compiler.Builder.Category.Code') + ); + } + + /** + * Get The AccessSectionsJoomlaFields Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsJoomlaFields + * @since 3.2.0 + */ + public function getAccessSectionsJoomlaFields(Container $container): AccessSectionsJoomlaFields + { + return new AccessSectionsJoomlaFields(); + } + /** * Get The Builders Class. * @@ -102,6 +214,7 @@ class Creator implements ServiceProviderInterface { return new Builders( $container->get('Config'), + $container->get('Power'), $container->get('Language'), $container->get('Placeholder'), $container->get('Compiler.Creator.Layout'), @@ -171,7 +284,212 @@ class Creator implements ServiceProviderInterface $container->get('Utilities.Structure'), $container->get('Field.Input.Button'), $container->get('Compiler.Builder.Field.Group.Control'), - $container->get('Compiler.Builder.Extension.Custom.Fields') + $container->get('Compiler.Builder.Extension.Custom.Fields'), + $container->get('Header'), + $container->get('Field.Core.Field') + ); + } + + /** + * Get The CustomButtonPermissions Class. + * + * @param Container $container The DI container. + * + * @return CustomButtonPermissions + * @since 3.2.0 + */ + public function getCustomButtonPermissions(Container $container): CustomButtonPermissions + { + return new CustomButtonPermissions( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Utilities.Counter') + ); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets( + $container->get('Config'), + $container->get('Component'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Creator.Field.As.String'), + $container->get('Compiler.Creator.Config.Fieldsets.Global'), + $container->get('Compiler.Creator.Config.Fieldsets.Site.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Group.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Uikit'), + $container->get('Compiler.Creator.Config.Fieldsets.Googlechart'), + $container->get('Compiler.Creator.Config.Fieldsets.Email.Helper'), + $container->get('Compiler.Creator.Config.Fieldsets.Encryption'), + $container->get('Compiler.Creator.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Config.Fieldsets') + ); + } + + /** + * Get The ConfigFieldsetsEmailHelper Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + public function getConfigFieldsetsEmailHelper(Container $container): ConfigFieldsetsEmailHelper + { + return new ConfigFieldsetsEmailHelper( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsEncryption Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEncryption + * @since 3.2.0 + */ + public function getConfigFieldsetsEncryption(Container $container): ConfigFieldsetsEncryption + { + return new ConfigFieldsetsEncryption( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGlobal Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGlobal + * @since 3.2.0 + */ + public function getConfigFieldsetsGlobal(Container $container): ConfigFieldsetsGlobal + { + return new ConfigFieldsetsGlobal( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Contributors'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGooglechart Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + public function getConfigFieldsetsGooglechart(Container $container): ConfigFieldsetsGooglechart + { + return new ConfigFieldsetsGooglechart( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Extensions.Params') + ); + } + + /** + * Get The ConfigFieldsetsGroupControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + public function getConfigFieldsetsGroupControl(Container $container): ConfigFieldsetsGroupControl + { + return new ConfigFieldsetsGroupControl( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Field.Group.Control'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsSiteControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + public function getConfigFieldsetsSiteControl(Container $container): ConfigFieldsetsSiteControl + { + return new ConfigFieldsetsSiteControl( + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Has.Menu.Global'), + $container->get('Compiler.Builder.Frontend.Params'), + $container->get('Compiler.Creator.Request') + ); + } + + /** + * Get The ConfigFieldsetsUikit Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsUikit + * @since 3.2.0 + */ + public function getConfigFieldsetsUikit(Container $container): ConfigFieldsetsUikit + { + return new ConfigFieldsetsUikit( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') ); } @@ -235,6 +553,21 @@ class Creator implements ServiceProviderInterface ); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request( + $container->get('Compiler.Builder.Request') + ); + } + /** * Get The FieldsetString Class. * diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power index c5e80ae..3a68e7c 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power @@ -8,12 +8,51 @@ */ public function register(Container $container) { + $container->alias(AccessSections::class, 'Compiler.Creator.Access.Sections') + ->share('Compiler.Creator.Access.Sections', [$this, 'getAccessSections'], true); + + $container->alias(AccessSectionsCategory::class, 'Compiler.Creator.Access.Sections.Category') + ->share('Compiler.Creator.Access.Sections.Category', [$this, 'getAccessSectionsCategory'], true); + + $container->alias(AccessSectionsJoomlaFields::class, 'Compiler.Creator.Access.Sections.Joomla.Fields') + ->share('Compiler.Creator.Access.Sections.Joomla.Fields', [$this, 'getAccessSectionsJoomlaFields'], true); + $container->alias(Builders::class, 'Compiler.Creator.Builders') ->share('Compiler.Creator.Builders', [$this, 'getBuilders'], true); $container->alias(CustomFieldTypeFile::class, 'Compiler.Creator.Custom.Field.Type.File') ->share('Compiler.Creator.Custom.Field.Type.File', [$this, 'getCustomFieldTypeFile'], true); + $container->alias(CustomButtonPermissions::class, 'Compiler.Creator.Custom.Button.Permissions') + ->share('Compiler.Creator.Custom.Button.Permissions', [$this, 'getCustomButtonPermissions'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Creator.Config.Fieldsets') + ->share('Compiler.Creator.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Creator.Config.Fieldsets.Customfield') + ->share('Compiler.Creator.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ConfigFieldsetsEmailHelper::class, 'Compiler.Creator.Config.Fieldsets.Email.Helper') + ->share('Compiler.Creator.Config.Fieldsets.Email.Helper', [$this, 'getConfigFieldsetsEmailHelper'], true); + + $container->alias(ConfigFieldsetsEncryption::class, 'Compiler.Creator.Config.Fieldsets.Encryption') + ->share('Compiler.Creator.Config.Fieldsets.Encryption', [$this, 'getConfigFieldsetsEncryption'], true); + + $container->alias(ConfigFieldsetsGlobal::class, 'Compiler.Creator.Config.Fieldsets.Global') + ->share('Compiler.Creator.Config.Fieldsets.Global', [$this, 'getConfigFieldsetsGlobal'], true); + + $container->alias(ConfigFieldsetsGooglechart::class, 'Compiler.Creator.Config.Fieldsets.Googlechart') + ->share('Compiler.Creator.Config.Fieldsets.Googlechart', [$this, 'getConfigFieldsetsGooglechart'], true); + + $container->alias(ConfigFieldsetsGroupControl::class, 'Compiler.Creator.Config.Fieldsets.Group.Control') + ->share('Compiler.Creator.Config.Fieldsets.Group.Control', [$this, 'getConfigFieldsetsGroupControl'], true); + + $container->alias(ConfigFieldsetsSiteControl::class, 'Compiler.Creator.Config.Fieldsets.Site.Control') + ->share('Compiler.Creator.Config.Fieldsets.Site.Control', [$this, 'getConfigFieldsetsSiteControl'], true); + + $container->alias(ConfigFieldsetsUikit::class, 'Compiler.Creator.Config.Fieldsets.Uikit') + ->share('Compiler.Creator.Config.Fieldsets.Uikit', [$this, 'getConfigFieldsetsUikit'], true); + $container->alias(Layout::class, 'Compiler.Creator.Layout') ->share('Compiler.Creator.Layout', [$this, 'getLayout'], true); @@ -23,6 +62,9 @@ $container->alias(SiteFieldData::class, 'Compiler.Creator.Site.Field.Data') ->share('Compiler.Creator.Site.Field.Data', [$this, 'getSiteFieldData'], true); + $container->alias(Request::class, 'Compiler.Creator.Request') + ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -51,6 +93,62 @@ ->share('Compiler.Creator.Fieldset', [$this, 'getFieldset'], true); } + /** + * Get The AccessSections Class. + * + * @param Container $container The DI container. + * + * @return AccessSections + * @since 3.2.0 + */ + public function getAccessSections(Container $container): AccessSections + { + return new AccessSections( + $container->get('Config'), + $container->get('Event'), + $container->get('Language'), + $container->get('Component'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Utilities.Counter'), + $container->get('Compiler.Creator.Permission'), + $container->get('Compiler.Builder.Assets.Rules'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Compiler.Builder.Permission.Views'), + $container->get('Compiler.Builder.Permission.Fields'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Compiler.Creator.Custom.Button.Permissions') + ); + } + + /** + * Get The AccessSectionsCategory Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsCategory + * @since 3.2.0 + */ + public function getAccessSectionsCategory(Container $container): AccessSectionsCategory + { + return new AccessSectionsCategory( + $container->get('Compiler.Builder.Category.Code') + ); + } + + /** + * Get The AccessSectionsJoomlaFields Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsJoomlaFields + * @since 3.2.0 + */ + public function getAccessSectionsJoomlaFields(Container $container): AccessSectionsJoomlaFields + { + return new AccessSectionsJoomlaFields(); + } + /** * Get The Builders Class. * @@ -63,6 +161,7 @@ { return new Builders( $container->get('Config'), + $container->get('Power'), $container->get('Language'), $container->get('Placeholder'), $container->get('Compiler.Creator.Layout'), @@ -132,7 +231,212 @@ $container->get('Utilities.Structure'), $container->get('Field.Input.Button'), $container->get('Compiler.Builder.Field.Group.Control'), - $container->get('Compiler.Builder.Extension.Custom.Fields') + $container->get('Compiler.Builder.Extension.Custom.Fields'), + $container->get('Header'), + $container->get('Field.Core.Field') + ); + } + + /** + * Get The CustomButtonPermissions Class. + * + * @param Container $container The DI container. + * + * @return CustomButtonPermissions + * @since 3.2.0 + */ + public function getCustomButtonPermissions(Container $container): CustomButtonPermissions + { + return new CustomButtonPermissions( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Utilities.Counter') + ); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets( + $container->get('Config'), + $container->get('Component'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Creator.Field.As.String'), + $container->get('Compiler.Creator.Config.Fieldsets.Global'), + $container->get('Compiler.Creator.Config.Fieldsets.Site.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Group.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Uikit'), + $container->get('Compiler.Creator.Config.Fieldsets.Googlechart'), + $container->get('Compiler.Creator.Config.Fieldsets.Email.Helper'), + $container->get('Compiler.Creator.Config.Fieldsets.Encryption'), + $container->get('Compiler.Creator.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Config.Fieldsets') + ); + } + + /** + * Get The ConfigFieldsetsEmailHelper Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + public function getConfigFieldsetsEmailHelper(Container $container): ConfigFieldsetsEmailHelper + { + return new ConfigFieldsetsEmailHelper( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsEncryption Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEncryption + * @since 3.2.0 + */ + public function getConfigFieldsetsEncryption(Container $container): ConfigFieldsetsEncryption + { + return new ConfigFieldsetsEncryption( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGlobal Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGlobal + * @since 3.2.0 + */ + public function getConfigFieldsetsGlobal(Container $container): ConfigFieldsetsGlobal + { + return new ConfigFieldsetsGlobal( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Contributors'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGooglechart Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + public function getConfigFieldsetsGooglechart(Container $container): ConfigFieldsetsGooglechart + { + return new ConfigFieldsetsGooglechart( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Extensions.Params') + ); + } + + /** + * Get The ConfigFieldsetsGroupControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + public function getConfigFieldsetsGroupControl(Container $container): ConfigFieldsetsGroupControl + { + return new ConfigFieldsetsGroupControl( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Field.Group.Control'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsSiteControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + public function getConfigFieldsetsSiteControl(Container $container): ConfigFieldsetsSiteControl + { + return new ConfigFieldsetsSiteControl( + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Has.Menu.Global'), + $container->get('Compiler.Builder.Frontend.Params'), + $container->get('Compiler.Creator.Request') + ); + } + + /** + * Get The ConfigFieldsetsUikit Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsUikit + * @since 3.2.0 + */ + public function getConfigFieldsetsUikit(Container $container): ConfigFieldsetsUikit + { + return new ConfigFieldsetsUikit( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') ); } @@ -196,6 +500,21 @@ ); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request( + $container->get('Compiler.Builder.Request') + ); + } + /** * Get The FieldsetString Class. * diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json index d7e8269..9612be6 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json @@ -13,58 +13,114 @@ "type": "class", "use_selection": { "use_selection0": { - "use": "55278140-80d5-4168-8241-d64515c4b35e", + "use": "15615db0-02b9-454f-a82e-1ab39ae5e6a9", "as": "default" }, "use_selection1": { - "use": "6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96", + "use": "6d179307-b6e5-4f50-962b-5b6360d0759e", "as": "default" }, "use_selection2": { - "use": "a0f032db-2242-41df-8e4a-5e9e6f88201d", + "use": "396f9883-4e50-4b65-a1d5-05bd6c23df30", "as": "default" }, "use_selection3": { - "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "use": "55278140-80d5-4168-8241-d64515c4b35e", "as": "default" }, "use_selection4": { - "use": "15b4addf-bf6b-4691-9c92-858c7de9c2c1", + "use": "6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96", "as": "default" }, "use_selection5": { - "use": "05448890-e324-41a0-b6db-d804bfc241cc", + "use": "8bf026e7-9ae0-423c-b74b-5bc16c54acf7", "as": "default" }, "use_selection6": { - "use": "79739667-72c6-4576-9830-7b1eb92e4791", + "use": "20cf1825-29d0-4c6c-8fe9-a1e13a4dac53", "as": "default" }, "use_selection7": { - "use": "b5986fab-17ca-4236-8c0c-81ebd2bb82ba", + "use": "208bc37c-0055-44df-9a34-63d6bfa10765", "as": "default" }, "use_selection8": { - "use": "ac691a05-5630-4002-b166-dedec3fb0fcb", + "use": "d80e58b8-8462-47c4-9dcd-380445f1c64a", "as": "default" }, "use_selection9": { - "use": "44d039b9-d293-481b-b560-23a6e7a63962", + "use": "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab", "as": "default" }, "use_selection10": { - "use": "4801f8b0-4a4a-4eda-8f0e-cf77f042c35e", + "use": "0fe3133d-1ff3-4444-9229-4218d8fb338e", "as": "default" }, "use_selection11": { - "use": "f48764e0-16c6-459c-8576-af7616f3b720", + "use": "31c8127c-0d42-4e09-be81-7cf243c5b30f", "as": "default" }, "use_selection12": { + "use": "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74", + "as": "default" + }, + "use_selection13": { + "use": "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11", + "as": "default" + }, + "use_selection14": { + "use": "84c11075-570a-4907-9be0-9305e0fabe3c", + "as": "default" + }, + "use_selection15": { + "use": "a0f032db-2242-41df-8e4a-5e9e6f88201d", + "as": "default" + }, + "use_selection16": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection17": { + "use": "15b4addf-bf6b-4691-9c92-858c7de9c2c1", + "as": "default" + }, + "use_selection18": { + "use": "cfdf0968-f394-4459-933c-ad1674fb1041", + "as": "default" + }, + "use_selection19": { + "use": "05448890-e324-41a0-b6db-d804bfc241cc", + "as": "default" + }, + "use_selection20": { + "use": "79739667-72c6-4576-9830-7b1eb92e4791", + "as": "default" + }, + "use_selection21": { + "use": "b5986fab-17ca-4236-8c0c-81ebd2bb82ba", + "as": "default" + }, + "use_selection22": { + "use": "ac691a05-5630-4002-b166-dedec3fb0fcb", + "as": "default" + }, + "use_selection23": { + "use": "44d039b9-d293-481b-b560-23a6e7a63962", + "as": "default" + }, + "use_selection24": { + "use": "4801f8b0-4a4a-4eda-8f0e-cf77f042c35e", + "as": "default" + }, + "use_selection25": { + "use": "f48764e0-16c6-459c-8576-af7616f3b720", + "as": "default" + }, + "use_selection26": { "use": "2d27c436-4d8e-4692-8382-d9e97af2231c", "as": "FieldType" }, - "use_selection13": { + "use_selection27": { "use": "d44f3294-6b68-4d85-a617-15fb772b7d14", "as": "Fieldset" } diff --git a/src/98419ff3-6628-4539-8365-37f88378bced/README.md b/src/98419ff3-6628-4539-8365-37f88378bced/README.md new file mode 100644 index 0000000..12b55ad --- /dev/null +++ b/src/98419ff3-6628-4539-8365-37f88378bced/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Request (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class Request << (F,LightGreen) >> #RoyalBlue { + # bool $addAsArray +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/98419ff3-6628-4539-8365-37f88378bced/code.php b/src/98419ff3-6628-4539-8365-37f88378bced/code.php new file mode 100644 index 0000000..3ee1100 --- /dev/null +++ b/src/98419ff3-6628-4539-8365-37f88378bced/code.php @@ -0,0 +1,42 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Permission Strict Per Field Builder Class + * + * @since 3.2.0 + */ +final class Request extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; +} + diff --git a/src/98419ff3-6628-4539-8365-37f88378bced/code.power b/src/98419ff3-6628-4539-8365-37f88378bced/code.power new file mode 100644 index 0000000..c535c92 --- /dev/null +++ b/src/98419ff3-6628-4539-8365-37f88378bced/code.power @@ -0,0 +1,14 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; \ No newline at end of file diff --git a/src/98419ff3-6628-4539-8365-37f88378bced/settings.json b/src/98419ff3-6628-4539-8365-37f88378bced/settings.json new file mode 100644 index 0000000..01778db --- /dev/null +++ b/src/98419ff3-6628-4539-8365-37f88378bced/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "98419ff3-6628-4539-8365-37f88378bced", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "Request", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.Request", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.Request", + "description": "Permission Strict Per Field Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/992a842f-1ba9-4a5c-b214-042459ffe038/README.md b/src/992a842f-1ba9-4a5c-b214-042459ffe038/README.md new file mode 100644 index 0000000..c13e64e --- /dev/null +++ b/src/992a842f-1ba9-4a5c-b214-042459ffe038/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface AllowEditInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller** +```uml +@startuml +interface AllowEditInterface #Lavender { + + get(string $nameSingleCode, string $nameListCode) : string +} + +note right of AllowEditInterface::get + Get Allow Edit Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/992a842f-1ba9-4a5c-b214-042459ffe038/code.php b/src/992a842f-1ba9-4a5c-b214-042459ffe038/code.php new file mode 100644 index 0000000..5b9af6f --- /dev/null +++ b/src/992a842f-1ba9-4a5c-b214-042459ffe038/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\Architecture\Controller; + + +/** + * Controller Allow Edit Interface + * + * @since 3.2.0 + */ +interface AllowEditInterface +{ + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string; +} + diff --git a/src/992a842f-1ba9-4a5c-b214-042459ffe038/code.power b/src/992a842f-1ba9-4a5c-b214-042459ffe038/code.power new file mode 100644 index 0000000..cdb87c3 --- /dev/null +++ b/src/992a842f-1ba9-4a5c-b214-042459ffe038/code.power @@ -0,0 +1,10 @@ + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string; \ No newline at end of file diff --git a/src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json b/src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json new file mode 100644 index 0000000..6f03738 --- /dev/null +++ b/src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "992a842f-1ba9-4a5c-b214-042459ffe038", + "implements": null, + "load_selection": null, + "name": "AllowEditInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Architecture.Controller.AllowEdit", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Architecture.Controller.AllowEditInterface", + "description": "Controller Allow Edit Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/README.md b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/README.md new file mode 100644 index 0000000..1954036 --- /dev/null +++ b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AssetsRules (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class AssetsRules << (F,LightGreen) >> #RoyalBlue { + # bool $addAsArray +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php new file mode 100644 index 0000000..0d24e09 --- /dev/null +++ b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php @@ -0,0 +1,42 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Assets Rules Builder Class + * + * @since 3.2.0 + */ +final class AssetsRules extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; +} + diff --git a/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.power b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.power new file mode 100644 index 0000000..c535c92 --- /dev/null +++ b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.power @@ -0,0 +1,14 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; \ No newline at end of file diff --git a/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json new file mode 100644 index 0000000..337accc --- /dev/null +++ b/src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "9b5872d6-c1d8-4602-b443-5844d2c950ee", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "AssetsRules", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.AssetsRules", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.AssetsRules", + "description": "Assets Rules Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md index 614e877..8b3ef7a 100644 --- a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md @@ -12,8 +12,8 @@ @startuml class Sqldump #Gold { # Registry $registry - # \JDatabaseDriver $db - + __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + # $db + + __construct(?Registry $registry = null) + get(array $tables, string $view, ...) : ?string # escape(string|array $value) : string|array } diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php index e6ed675..bc76ac2 100644 --- a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php @@ -38,10 +38,9 @@ class Sqldump /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -51,10 +50,10 @@ class Sqldump * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + public function __construct(?Registry $registry = null) { $this->registry = $registry ?: Compiler::_('Registry'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.power b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.power index 4be3abd..52223bb 100644 --- a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.power +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.power @@ -9,10 +9,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -22,10 +21,10 @@ * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + public function __construct(?Registry $registry = null) { $this->registry = $registry ?: Compiler::_('Registry'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/README.md b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/README.md new file mode 100644 index 0000000..b48660d --- /dev/null +++ b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsGroupControl (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsGroupControl << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # FieldGroupControl $fieldgroupcontrol + # ConfigFieldsets $configfieldsets + # ExtensionsParams $extensionsparams + # Customfield $customfield + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsGroupControl::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + FieldGroupControl $fieldgroupcontrol + ConfigFieldsets $configfieldsets + ExtensionsParams $extensionsparams + Customfield $customfield +end note + +note right of ConfigFieldsetsGroupControl::set + Set Group Control Config Fieldsets + + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php new file mode 100644 index 0000000..3904bf7 --- /dev/null +++ b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php @@ -0,0 +1,163 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Config Fieldsets Group Control Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsGroupControl +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The FieldGroupControl Class. + * + * @var FieldGroupControl + * @since 3.2.0 + */ + protected FieldGroupControl $fieldgroupcontrol; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param FieldGroupControl $fieldgroupcontrol The FieldGroupControl Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + FieldGroupControl $fieldgroupcontrol, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->fieldgroupcontrol = $fieldgroupcontrol; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Group Control Config Fieldsets + * + * @param string $lang + * + * @since 1.0 + */ + public function set(string $lang): void + { + // start loading Group control params if needed + if ($this->fieldgroupcontrol->isActive()) + { + // start building field set for config + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="group_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_GROUPS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_GROUPS_DESC">'); + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_GROUPS_LABEL', "Target Groups" + ); + $this->language->set( + $this->config->lang_target, $lang . '_GROUPS_DESC', + "The Parameters for the targeted groups are set here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_TARGET_GROUP_DESC', + "Set the group/s being targeted by this user type." + ); + + foreach ($this->fieldgroupcontrol->allActive() as $selector => $label) + { + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="usergroup"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $label . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_TARGET_GROUP_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'multiple="true"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // set params defaults + $this->extensionsparams->add('component', '"' . $selector . '":["2"]'); + } + // add custom Target Groups fields + if ($this->customfield->isArray('Target Groups')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Target Groups') + )); + $this->customfield->remove('Target Groups'); + } + // close that fieldse + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } +} + diff --git a/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.power b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.power new file mode 100644 index 0000000..e5b9f05 --- /dev/null +++ b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.power @@ -0,0 +1,131 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The FieldGroupControl Class. + * + * @var FieldGroupControl + * @since 3.2.0 + */ + protected FieldGroupControl $fieldgroupcontrol; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ExtensionsParams Class. + * + * @var ExtensionsParams + * @since 3.2.0 + */ + protected ExtensionsParams $extensionsparams; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param FieldGroupControl $fieldgroupcontrol The FieldGroupControl Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param ExtensionsParams $extensionsparams The ExtensionsParams Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, + FieldGroupControl $fieldgroupcontrol, + ConfigFieldsets $configfieldsets, + ExtensionsParams $extensionsparams, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->fieldgroupcontrol = $fieldgroupcontrol; + $this->configfieldsets = $configfieldsets; + $this->extensionsparams = $extensionsparams; + $this->customfield = $customfield; + } + + /** + * Set Group Control Config Fieldsets + * + * @param string $lang + * + * @since 1.0 + */ + public function set(string $lang): void + { + // start loading Group control params if needed + if ($this->fieldgroupcontrol->isActive()) + { + // start building field set for config + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) . 'name="group_config"'); + $this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang + . '_GROUPS_LABEL"'); + $this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang + . '_GROUPS_DESC">'); + // setup lang + $this->language->set( + $this->config->lang_target, $lang . '_GROUPS_LABEL', "Target Groups" + ); + $this->language->set( + $this->config->lang_target, $lang . '_GROUPS_DESC', + "The Parameters for the targeted groups are set here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_TARGET_GROUP_DESC', + "Set the group/s being targeted by this user type." + ); + + foreach ($this->fieldgroupcontrol->allActive() as $selector => $label) + { + $this->configfieldsets->add('component', Indent::_(2) . 'configfieldsets->add('component', Indent::_(3) . 'type="usergroup"'); + $this->configfieldsets->add('component', Indent::_(3) . 'label="' . $label . '"'); + $this->configfieldsets->add('component', Indent::_(3) . 'description="' + . $lang . '_TARGET_GROUP_DESC"'); + $this->configfieldsets->add('component', Indent::_(3) . 'multiple="true"'); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + // set params defaults + $this->extensionsparams->add('component', '"' . $selector . '":["2"]'); + } + // add custom Target Groups fields + if ($this->customfield->isArray('Target Groups')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Target Groups') + )); + $this->customfield->remove('Target Groups'); + } + // close that fieldse + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } \ No newline at end of file diff --git a/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json new file mode 100644 index 0000000..e4fddfe --- /dev/null +++ b/src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json @@ -0,0 +1,47 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsGroupControl", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsGroupControl", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "d5530adf-c809-45a9-87fc-7cecd3d972d8", + "as": "default" + }, + "use_selection3": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection4": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection5": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection6": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsGroupControl", + "description": "Config Fieldsets Group Control Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php index 0ef0974..f61ca6b 100644 --- a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php @@ -459,14 +459,30 @@ class Structure if ($add_component_path) { $xml .= PHP_EOL . 'config->get('joomla_version', 3) == 3) + { + $xml .= PHP_EOL . Indent::_(1) + . 'addrulepath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(1) + . 'addfieldpath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/fields"'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'; + $xml .= PHP_EOL . Indent::_(1) + .'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'; + } + $xml .= PHP_EOL . '>'; } else diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power index 3016069..1b4d137 100644 --- a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power @@ -419,14 +419,30 @@ if ($add_component_path) { $xml .= PHP_EOL . 'config->get('joomla_version', 3) == 3) + { + $xml .= PHP_EOL . Indent::_(1) + . 'addrulepath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(1) + . 'addfieldpath="/administrator/components/com_' + . $this->config->component_code_name + . '/models/fields"'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) + . 'addruleprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Rule"'; + $xml .= PHP_EOL . Indent::_(1) + .'addfieldprefix="' . $this->config->namespace_prefix + . '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F') + . '\Administrator\Field"'; + } + $xml .= PHP_EOL . '>'; } else diff --git a/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/README.md b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/README.md new file mode 100644 index 0000000..111d500 --- /dev/null +++ b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsSiteControl (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsSiteControl << (F,LightGreen) >> #RoyalBlue { + # Component $component + # ConfigFieldsets $configfieldsets + # Customfield $customfield + # HasMenuGlobal $hasmenuglobal + # FrontendParams $frontendparams + # Request $request + + __construct(Component $component, ConfigFieldsets $configfieldsets, ...) + + set(string $lang) : void +} + +note right of ConfigFieldsetsSiteControl::__construct + Constructor. + + since: 3.2.0 + + arguments: + Component $component + ConfigFieldsets $configfieldsets + Customfield $customfield + HasMenuGlobal $hasmenuglobal + FrontendParams $frontendparams + Request $request +end note + +note right of ConfigFieldsetsSiteControl::set + Set Site Control Config Fieldsets + + 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/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php new file mode 100644 index 0000000..fc09441 --- /dev/null +++ b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php @@ -0,0 +1,225 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Request; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Config Fieldsets Site Control Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsSiteControl +{ + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The HasMenuGlobal Class. + * + * @var HasMenuGlobal + * @since 3.2.0 + */ + protected HasMenuGlobal $hasmenuglobal; + + /** + * The FrontendParams Class. + * + * @var FrontendParams + * @since 3.2.0 + */ + protected FrontendParams $frontendparams; + + /** + * The Request Class. + * + * @var Request + * @since 3.2.0 + */ + protected Request $request; + + /** + * Constructor. + * + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param HasMenuGlobal $hasmenuglobal The HasMenuGlobal Class. + * @param FrontendParams $frontendparams The FrontendParams Class. + * @param Request $request The Request Class. + * + * @since 3.2.0 + */ + public function __construct(Component $component, ConfigFieldsets $configfieldsets, + Customfield $customfield, HasMenuGlobal $hasmenuglobal, + FrontendParams $frontendparams, Request $request) + { + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + $this->hasmenuglobal = $hasmenuglobal; + $this->frontendparams = $frontendparams; + $this->request = $request; + } + + /** + * Set Site Control Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + $front_end = []; + // do quick build of front-end views + if ($this->component->isArray('site_views')) + { + // load the names only to link the page params + foreach ($this->component->get('site_views') as $siteView) + { + // now load the view name to the front-end array + $front_end[] = $siteView['settings']->name; + } + } + + // add frontend view stuff including menus + if ($this->customfield->isActive()) + { + foreach ($this->customfield->allActive() as $tab => $tabFields) + { + $tabCode = StringHelper::safe($tab) . '_custom_config'; + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); + + // load the request id setters for menu views + $viewRequest = 'name="' . $tabLower . '_request_id'; + foreach ($tabFields as $et => $id_field) + { + if (strpos((string) $id_field, $viewRequest) !== false) + { + $this->request->set( + $tabLower, $id_field, $viewRequest, 'id' + ); + $this->customfield->remove("$tab.$et"); + unset($tabFields[$et]); + } + elseif (strpos((string) $id_field, '_request_id') !== false) + { + // not loaded to a tab "view" name + $_viewRequest = GetHelper::between( + $id_field, 'name="', '_request_id' + ); + $searchIdKe = 'name="' . $_viewRequest + . '_request_id'; + $this->request->set( + $_viewRequest, $id_field, $searchIdKe, 'id' + ); + $this->customfield->remove("$tab.$et"); + unset($tabFields[$et]); + } + } + + // load the request catid setters for menu views + $viewRequestC = 'name="' . $tabLower . '_request_catid'; + foreach ($tabFields as $ci => $catid_field) + { + if (strpos((string) $catid_field, $viewRequestC) !== false) + { + + $this->request->set( + $tabLower, $catid_field, $viewRequestC, 'catid' + ); + $this->customfield->remove("$tab.$ci"); + unset($tabFields[$ci]); + } + elseif (strpos((string) $catid_field, '_request_catid') !== false) + { + // not loaded to a tab "view" name + $_viewRequestC = GetHelper::between( + $catid_field, 'name="', '_request_catid' + ); + $searchCatidKe = 'name="' . $_viewRequestC + . '_request_catid'; + $this->request->set( + $_viewRequestC, $catid_field, $searchCatidKe, 'catid' + ); + $this->customfield->remove("$tab.$ci"); + unset($tabFields[$ci]); + } + } + + // load the global menu setters for single fields + $menuSetter = $tabLower . '_menu'; + $pageSettings = []; + foreach ($tabFields as $ct => $field) + { + if (strpos((string) $field, $menuSetter) !== false) + { + // set the values needed to insure route is done correclty + $this->hasmenuglobal->set($tabLower, $menuSetter); + } + elseif (strpos((string) $field, '_menu"') !== false) + { + // not loaded to a tab "view" name + $_tabLower = GetHelper::between( + $field, 'name="', '_menu"' + ); + // set the values needed to insure route is done correclty + $this->hasmenuglobal->set($_tabLower, $_tabLower . '_menu'); + } + else + { + $pageSettings[$ct] = $field; + } + } + + // insure we load the needed params + if (in_array($tab, $front_end)) + { + $this->frontendparams->set($tab, $pageSettings); + } + } + } + } +} + diff --git a/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.power b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.power new file mode 100644 index 0000000..2d20e59 --- /dev/null +++ b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.power @@ -0,0 +1,192 @@ + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * The HasMenuGlobal Class. + * + * @var HasMenuGlobal + * @since 3.2.0 + */ + protected HasMenuGlobal $hasmenuglobal; + + /** + * The FrontendParams Class. + * + * @var FrontendParams + * @since 3.2.0 + */ + protected FrontendParams $frontendparams; + + /** + * The Request Class. + * + * @var Request + * @since 3.2.0 + */ + protected Request $request; + + /** + * Constructor. + * + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * @param HasMenuGlobal $hasmenuglobal The HasMenuGlobal Class. + * @param FrontendParams $frontendparams The FrontendParams Class. + * @param Request $request The Request Class. + * + * @since 3.2.0 + */ + public function __construct(Component $component, ConfigFieldsets $configfieldsets, + Customfield $customfield, HasMenuGlobal $hasmenuglobal, + FrontendParams $frontendparams, Request $request) + { + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + $this->hasmenuglobal = $hasmenuglobal; + $this->frontendparams = $frontendparams; + $this->request = $request; + } + + /** + * Set Site Control Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + $front_end = []; + // do quick build of front-end views + if ($this->component->isArray('site_views')) + { + // load the names only to link the page params + foreach ($this->component->get('site_views') as $siteView) + { + // now load the view name to the front-end array + $front_end[] = $siteView['settings']->name; + } + } + + // add frontend view stuff including menus + if ($this->customfield->isActive()) + { + foreach ($this->customfield->allActive() as $tab => $tabFields) + { + $tabCode = StringHelper::safe($tab) . '_custom_config'; + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); + + // load the request id setters for menu views + $viewRequest = 'name="' . $tabLower . '_request_id'; + foreach ($tabFields as $et => $id_field) + { + if (strpos((string) $id_field, $viewRequest) !== false) + { + $this->request->set( + $tabLower, $id_field, $viewRequest, 'id' + ); + $this->customfield->remove("$tab.$et"); + unset($tabFields[$et]); + } + elseif (strpos((string) $id_field, '_request_id') !== false) + { + // not loaded to a tab "view" name + $_viewRequest = GetHelper::between( + $id_field, 'name="', '_request_id' + ); + $searchIdKe = 'name="' . $_viewRequest + . '_request_id'; + $this->request->set( + $_viewRequest, $id_field, $searchIdKe, 'id' + ); + $this->customfield->remove("$tab.$et"); + unset($tabFields[$et]); + } + } + + // load the request catid setters for menu views + $viewRequestC = 'name="' . $tabLower . '_request_catid'; + foreach ($tabFields as $ci => $catid_field) + { + if (strpos((string) $catid_field, $viewRequestC) !== false) + { + + $this->request->set( + $tabLower, $catid_field, $viewRequestC, 'catid' + ); + $this->customfield->remove("$tab.$ci"); + unset($tabFields[$ci]); + } + elseif (strpos((string) $catid_field, '_request_catid') !== false) + { + // not loaded to a tab "view" name + $_viewRequestC = GetHelper::between( + $catid_field, 'name="', '_request_catid' + ); + $searchCatidKe = 'name="' . $_viewRequestC + . '_request_catid'; + $this->request->set( + $_viewRequestC, $catid_field, $searchCatidKe, 'catid' + ); + $this->customfield->remove("$tab.$ci"); + unset($tabFields[$ci]); + } + } + + // load the global menu setters for single fields + $menuSetter = $tabLower . '_menu'; + $pageSettings = []; + foreach ($tabFields as $ct => $field) + { + if (strpos((string) $field, $menuSetter) !== false) + { + // set the values needed to insure route is done correclty + $this->hasmenuglobal->set($tabLower, $menuSetter); + } + elseif (strpos((string) $field, '_menu"') !== false) + { + // not loaded to a tab "view" name + $_tabLower = GetHelper::between( + $field, 'name="', '_menu"' + ); + // set the values needed to insure route is done correclty + $this->hasmenuglobal->set($_tabLower, $_tabLower . '_menu'); + } + else + { + $pageSettings[$ct] = $field; + } + } + + // insure we load the needed params + if (in_array($tab, $front_end)) + { + $this->frontendparams->set($tab, $pageSettings); + } + } + } + } \ No newline at end of file diff --git a/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json new file mode 100644 index 0000000..f4a6949 --- /dev/null +++ b/src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json @@ -0,0 +1,51 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsSiteControl", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsSiteControl", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection1": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection2": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection3": { + "use": "6992384f-4f29-489f-a52e-286e03f4593b", + "as": "default" + }, + "use_selection4": { + "use": "207b5ef3-b3bb-45bf-af14-4572e296d761", + "as": "default" + }, + "use_selection5": { + "use": "cfdf0968-f394-4459-933c-ad1674fb1041", + "as": "default" + }, + "use_selection6": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection7": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsSiteControl", + "description": "Config Fieldsets Site Control Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md index 5d1cebc..4daf069 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md @@ -14,7 +14,7 @@ class Placeholder << (F,LightGreen) >> #RoyalBlue { # $placeholders # $config # $db - + __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + + __construct(?Config $config = null) + get() : array } diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php index 39cc7e5..472c70c 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php @@ -49,7 +49,6 @@ final class Placeholder implements PlaceholderInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ protected $db; @@ -62,10 +61,10 @@ final class Placeholder implements PlaceholderInterface * * @since 3.2.0 **/ - public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + public function __construct(?Config $config = null) { $this->config = $config ?: Compiler::_('Config'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power index 2b6727a..65f69ac 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power @@ -17,7 +17,6 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ protected $db; @@ -30,10 +29,10 @@ * * @since 3.2.0 **/ - public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + public function __construct(?Config $config = null) { $this->config = $config ?: Compiler::_('Config'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php index 4bd1fc9..45f11cf 100644 --- a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php +++ b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php @@ -15,7 +15,7 @@ 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\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Component; use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; diff --git a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json index 9e26352..9b713d1 100644 --- a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json +++ b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json @@ -23,8 +23,8 @@ "as": "default" }, "use_selection3": { - "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", - "as": "default" + "use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "as": "Settings" }, "use_selection4": { "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md index 4a5539f..e44cf7a 100644 --- a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md @@ -23,8 +23,8 @@ class Power #Gold { # Customcode $customcode # Gui $gui # Superpower $superpower - # \JDatabaseDriver $db - # CMSApplication $app + # $db + # $app + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) + load(array $guids) : void + get(string $guid, int $build) : ?object @@ -59,8 +59,6 @@ note right of Power::__construct ?Customcode $customcode = null ?Gui $gui = null ?Superpower $superpower = null - ?\JDatabaseDriver $db = null - ?CMSApplication $app = null end note note left of Power::load diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php index 314ae6a..738ec56 100644 --- a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php @@ -144,18 +144,16 @@ class Power implements PowerInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -165,23 +163,20 @@ class Power implements PowerInterface * @param Customcode|null $customcode The compiler customcode object. * @param Gui|null $gui The compiler customcode gui object. * @param Superpower|null $superpower The JCB superpower 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, ?Superpower $superpower = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->superpower = $superpower ?: Compiler::_('Superpower'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.power b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.power index f9fa9a6..9fdb9f9 100644 --- a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.power +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.power @@ -105,18 +105,16 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -126,23 +124,20 @@ * @param Customcode|null $customcode The compiler customcode object. * @param Gui|null $gui The compiler customcode gui object. * @param Superpower|null $superpower The JCB superpower 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, ?Superpower $superpower = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->superpower = $superpower ?: Compiler::_('Superpower'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md index 4e7645c..b103117 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md @@ -15,6 +15,7 @@ class Event #Gold { + register(Container $container) : void + getEvent(Container $container) : EventInterface + getJ3Event(Container $container) : J3Event + + getJ4Event(Container $container) : J4Event } note right of Event::register @@ -37,6 +38,13 @@ note right of Event::getJ3Event since: 3.2.0 return: J3Event end note + +note right of Event::getJ4Event + Get the Joomla 4 Event + + since: 3.2.0 + return: J4Event +end note @enduml ``` diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php index 091f7c2..156a293 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event; /** @@ -47,6 +48,9 @@ class Event implements ServiceProviderInterface $container->alias(J3Event::class, 'J3.Event') ->share('J3.Event', [$this, 'getJ3Event'], true); + $container->alias(J4Event::class, 'J4.Event') + ->share('J4.Event', [$this, 'getJ4Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -81,6 +85,18 @@ class Event implements ServiceProviderInterface { return new J3Event(); } - + + /** + * Get the Joomla 4 Event + * + * @param Container $container The DI container. + * + * @return J4Event + * @since 3.2.0 + */ + public function getJ4Event(Container $container): J4Event + { + return new J4Event(); + } } diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power index 1d69ff5..7b78129 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power @@ -19,6 +19,9 @@ $container->alias(J3Event::class, 'J3.Event') ->share('J3.Event', [$this, 'getJ3Event'], true); + $container->alias(J4Event::class, 'J4.Event') + ->share('J4.Event', [$this, 'getJ4Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -53,3 +56,16 @@ { return new J3Event(); } + + /** + * Get the Joomla 4 Event + * + * @param Container $container The DI container. + * + * @return J4Event + * @since 3.2.0 + */ + public function getJ4Event(Container $container): J4Event + { + return new J4Event(); + } \ No newline at end of file diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json index 2ad153c..ae10668 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json @@ -19,6 +19,10 @@ "use_selection1": { "use": "4b86f62e-ce41-4325-a11a-08148807d0df", "as": "J3Event" + }, + "use_selection2": { + "use": "4729c2b0-f12b-4397-8d77-055d38bca98b", + "as": "J4Event" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Event", diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md index 1f10dc1..1e7f0d2 100644 --- a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md @@ -6,16 +6,16 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# interface CoreValidationInterface (Details) +# interface CoreRuleInterface (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field** ```uml @startuml -interface CoreValidationInterface #Lavender { +interface CoreRuleInterface #Lavender { + get(bool $lowercase = false) : array } -note right of CoreValidationInterface::get - Get the Array of Existing Validation Rule Names +note right of CoreRuleInterface::get + Get the Array of Existing Core Rule Names since: 3.2.0 return: array diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php index 8bf9641..5e09c28 100644 --- a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php @@ -13,14 +13,14 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field; /** - * Field Joomla Core Validation Interface + * Field Joomla Core Rule Interface * * @since 3.2.0 */ -interface CoreValidationInterface +interface CoreRuleInterface { /** - * Get the Array of Existing Validation Rule Names + * Get the Array of Existing Core Rule Names * * @param bool $lowercase Switch to set rules lowercase * diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.power b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.power index 848a334..4f827c5 100644 --- a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.power +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.power @@ -1,5 +1,5 @@ /** - * Get the Array of Existing Validation Rule Names + * Get the Array of Existing Core Rule Names * * @param bool $lowercase Switch to set rules lowercase * diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json index 9c7125d..1ec84db 100644 --- a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json @@ -5,13 +5,13 @@ "guid": "b9f05dc4-d23a-499a-a826-9749b81818ed", "implements": null, "load_selection": null, - "name": "CoreValidationInterface", + "name": "CoreRuleInterface", "power_version": "1.0.0", - "system_name": "JCB.Interfaces.Field.CoreValidationInterface", + "system_name": "JCB.Interfaces.Field.CoreRuleInterface", "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", + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Field.CoreRuleInterface", + "description": "Field Joomla Core Rule Interface\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md new file mode 100644 index 0000000..f3d83ab --- /dev/null +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class ArchitectureModel (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class ArchitectureModel #Gold { + # $targetVersion + + register(Container $container) : void + + getModelCanDelete(Container $container) : CanDeleteInterface + + getJ4ModelCanDelete(Container $container) : J4ModelCanDelete + + getJ3ModelCanDelete(Container $container) : J3ModelCanDelete + + getModelCanEditState(Container $container) : CanEditStateInterface + + getJ4ModelCanEditState(Container $container) : J4ModelCanEditState + + getJ3ModelCanEditState(Container $container) : J3ModelCanEditState +} + +note right of ArchitectureModel::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of ArchitectureModel::getModelCanDelete + Get The Model CanDelete Class. + + since: 3.2.0 + return: CanDeleteInterface +end note + +note right of ArchitectureModel::getJ4ModelCanDelete + Get The Model CanDelete Class. + + since: 3.2.0 + return: J4ModelCanDelete +end note + +note right of ArchitectureModel::getJ3ModelCanDelete + Get The Model CanDelete Class. + + since: 3.2.0 + return: J3ModelCanDelete +end note + +note right of ArchitectureModel::getModelCanEditState + Get The Model Can Edit State Class. + + since: 3.2.0 + return: CanEditStateInterface +end note + +note right of ArchitectureModel::getJ4ModelCanEditState + Get The Model Can Edit State Class. + + since: 3.2.0 + return: J4ModelCanEditState +end note + +note right of ArchitectureModel::getJ3ModelCanEditState + Get The Model Can Edit State Class. + + since: 3.2.0 + return: J3ModelCanEditState +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php new file mode 100644 index 0000000..5e87d15 --- /dev/null +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php @@ -0,0 +1,169 @@ + + * @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\Architecture\Model\CanDeleteInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState; + + +/** + * Architecture Model Service Provider + * + * @since 3.2.0 + */ +class ArchitectureModel 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(J3ModelCanDelete::class, 'Architecture.Model.J3.CanDelete') + ->share('Architecture.Model.J3.CanDelete', [$this, 'getJ3ModelCanDelete'], true); + + $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') + ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') + ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); + + $container->alias(J3ModelCanEditState::class, 'Architecture.Model.J3.CanEditState') + ->share('Architecture.Model.J3.CanEditState', [$this, 'getJ3ModelCanEditState'], true); + + $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') + ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') + ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return CanDeleteInterface + * @since 3.2.0 + */ + public function getModelCanDelete(Container $container): CanDeleteInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanDelete + * @since 3.2.0 + */ + public function getJ4ModelCanDelete(Container $container): J4ModelCanDelete + { + return new J4ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanDelete + * @since 3.2.0 + */ + public function getJ3ModelCanDelete(Container $container): J3ModelCanDelete + { + return new J3ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return CanEditStateInterface + * @since 3.2.0 + */ + public function getModelCanEditState(Container $container): CanEditStateInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanEditState + * @since 3.2.0 + */ + public function getJ4ModelCanEditState(Container $container): J4ModelCanEditState + { + return new J4ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanEditState + * @since 3.2.0 + */ + public function getJ3ModelCanEditState(Container $container): J3ModelCanEditState + { + return new J3ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } +} + diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power new file mode 100644 index 0000000..458d245 --- /dev/null +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power @@ -0,0 +1,136 @@ + /** + * 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(J3ModelCanDelete::class, 'Architecture.Model.J3.CanDelete') + ->share('Architecture.Model.J3.CanDelete', [$this, 'getJ3ModelCanDelete'], true); + + $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') + ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') + ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); + + $container->alias(J3ModelCanEditState::class, 'Architecture.Model.J3.CanEditState') + ->share('Architecture.Model.J3.CanEditState', [$this, 'getJ3ModelCanEditState'], true); + + $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') + ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') + ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return CanDeleteInterface + * @since 3.2.0 + */ + public function getModelCanDelete(Container $container): CanDeleteInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanDelete + * @since 3.2.0 + */ + public function getJ4ModelCanDelete(Container $container): J4ModelCanDelete + { + return new J4ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanDelete + * @since 3.2.0 + */ + public function getJ3ModelCanDelete(Container $container): J3ModelCanDelete + { + return new J3ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return CanEditStateInterface + * @since 3.2.0 + */ + public function getModelCanEditState(Container $container): CanEditStateInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanEditState + * @since 3.2.0 + */ + public function getJ4ModelCanEditState(Container $container): J4ModelCanEditState + { + return new J4ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanEditState + * @since 3.2.0 + */ + public function getJ3ModelCanEditState(Container $container): J3ModelCanEditState + { + return new J3ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } \ No newline at end of file diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json new file mode 100644 index 0000000..df5aec9 --- /dev/null +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json @@ -0,0 +1,46 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "bbd36fbf-d905-47e8-8e67-9ea6ec734712", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "ArchitectureModel", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.ArchitectureModel", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91", + "as": "default" + }, + "use_selection1": { + "use": "2a69a8ab-cea0-4c75-92d5-9495cb740e0f", + "as": "J4ModelCanDelete" + }, + "use_selection2": { + "use": "23766738-d0a4-4d0a-8555-7e4c97c0cddd", + "as": "J3ModelCanDelete" + }, + "use_selection3": { + "use": "600515b1-493f-4448-96fe-018e54e087c8", + "as": "default" + }, + "use_selection4": { + "use": "cb2a82a5-aa49-4d46-b765-9b3feb118208", + "as": "J4ModelCanEditState" + }, + "use_selection5": { + "use": "bce9ac2b-9f46-413f-b046-9e8af3f7dfbe", + "as": "J3ModelCanEditState" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.ArchitectureModel", + "description": "Architecture Model Service Provider\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/README.md b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/README.md new file mode 100644 index 0000000..9af1f82 --- /dev/null +++ b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CanEditState (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model** +```uml +@startuml +class CanEditState << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + + __construct(Config $config, Permission $permission) + + get(string $nameSingleCode) : string +} + +note right of CanEditState::__construct + Constructor. + + since: 3.2.0 +end note + +note right of CanEditState::get + Get Can Edit State Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php new file mode 100644 index 0000000..6088d4d --- /dev/null +++ b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php @@ -0,0 +1,108 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; + + +/** + * Model Can Edit State Class for Joomla 3 + * + * @since 3.2.0 + */ +final class CanEditState implements CanEditStateInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) + . "\$recordId = \$record->id ?? 0;"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.state') + . "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) + . "if (!\$permission && !is_null(\$permission))"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit.state')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component + . "');"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::canEditState(\$record);"; + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.power b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.power new file mode 100644 index 0000000..d619afd --- /dev/null +++ b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.power @@ -0,0 +1,78 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "\$user = Factory::getUser();"; + $allow[] = Indent::_(2) + . "\$recordId = \$record->id ?? 0;"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.state') + . "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) + . "if (!\$permission && !is_null(\$permission))"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit.state')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component + . "');"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::canEditState(\$record);"; + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json new file mode 100644 index 0000000..8bbe98c --- /dev/null +++ b/src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "bce9ac2b-9f46-413f-b046-9e8af3f7dfbe", + "implements": [ + "600515b1-493f-4448-96fe-018e54e087c8" + ], + "load_selection": null, + "name": "CanEditState", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J3.Model.CanEditState", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaThree.Model.CanEditState", + "description": "Model Can Edit State Class for Joomla 3\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/bcf1e767-1566-440d-9f67-5c1bada934fa/README.md b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/README.md new file mode 100644 index 0000000..4706871 --- /dev/null +++ b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ExtensionsParams (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class ExtensionsParams << (F,LightGreen) >> #RoyalBlue { + # bool $addAsArray +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php new file mode 100644 index 0000000..072de74 --- /dev/null +++ b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php @@ -0,0 +1,42 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Extensions Params Builder Class + * + * @since 3.2.0 + */ +final class ExtensionsParams extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; +} + diff --git a/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.power b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.power new file mode 100644 index 0000000..c535c92 --- /dev/null +++ b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.power @@ -0,0 +1,14 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; \ No newline at end of file diff --git a/src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json new file mode 100644 index 0000000..b307ed0 --- /dev/null +++ b/src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "ExtensionsParams", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.ExtensionsParams", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.ExtensionsParams", + "description": "Extensions Params Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/README.md b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/README.md index 508867b..4938da1 100644 --- a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/README.md +++ b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/README.md @@ -6,30 +6,15 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class InputButton (Details) -> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +# interface InputButtonInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field** ```uml @startuml -class InputButton << (F,LightGreen) >> #RoyalBlue { - # Config $config - # Placeholder $placeholder - # Permission $permission - + __construct(Config $config, Placeholder $placeholder, ...) +interface InputButtonInterface #Lavender { + get(array $fieldData) : string } -note right of InputButton::__construct - Constructor. - - since: 3.2.0 - - arguments: - Config $config - Placeholder $placeholder - Permission $permission -end note - -note right of InputButton::get +note right of InputButtonInterface::get get Add Button To List Field Input (getInput tweak) since: 3.2.0 diff --git a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php index d8754d2..4bdd513 100644 --- a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php +++ b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php @@ -9,16 +9,7 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Compiler\Field; - - -use VDM\Joomla\Componentbuilder\Compiler\Config; -use VDM\Joomla\Componentbuilder\Compiler\Placeholder; -use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field; /** @@ -26,49 +17,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; * * @since 3.2.0 */ -final class InputButton +interface InputButtonInterface { - /** - * The Config Class. - * - * @var Config - * @since 3.2.0 - */ - protected Config $config; - - /** - * The Placeholder Class. - * - * @var Placeholder - * @since 3.2.0 - */ - protected Placeholder $placeholder; - - /** - * The Permission Class. - * - * @var Permission - * @since 3.2.0 - */ - protected Permission $permission; - - /** - * Constructor. - * - * @param Config $config The Config Class. - * @param Placeholder $placeholder The Placeholder Class. - * @param Permission $permission The Permission Class. - * - * @since 3.2.0 - */ - public function __construct(Config $config, Placeholder $placeholder, - Permission $permission) - { - $this->config = $config; - $this->placeholder = $placeholder; - $this->permission = $permission; - } - /** * get Add Button To List Field Input (getInput tweak) * @@ -77,262 +27,6 @@ final class InputButton * @return string of getInput class on success empty string otherwise * @since 3.2.0 */ - public function get(array $fieldData): string - { - // make sure hte view values are set - if (isset($fieldData['add_button']) - && ($fieldData['add_button'] === 'true' - || 1 == $fieldData['add_button']) - && isset($fieldData['view']) - && isset($fieldData['views']) - && StringHelper::check($fieldData['view']) - && StringHelper::check($fieldData['views'])) - { - // set local component - $local_component = "com_" . $this->config->component_code_name; - // check that the component value is set - if (!isset($fieldData['component']) - || !StringHelper::check( - $fieldData['component'] - )) - { - $fieldData['component'] = $local_component; - } - // check that the component has the com_ value in it - if (strpos((string) $fieldData['component'], 'com_') === false - || strpos((string) $fieldData['component'], '=') !== false) - { - $fieldData['component'] = "com_" . $fieldData['component']; - } - // make sure the component is update if # # # or [ [ [ component placeholder is used - if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false - || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but - { - $fieldData['component'] = $this->placeholder->update_( - $fieldData['component'] - ); - } - // get core permissions - $coreLoad = false; - // add ref tags - $refLoad = true; - // fall back on the field component - $component = $fieldData['component']; - // check if we should add ref tags (since it only works well on local views) - if ($local_component !== $component) - { - // do not add ref tags - $refLoad = false; - } - // start building the add buttons/s - $addButton = array(); - $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; - $addButton[] = Indent::_(1) . " * Override to add new button"; - $addButton[] = Indent::_(1) . " *"; - $addButton[] = Indent::_(1) - . " * @return string The field input markup."; - $addButton[] = Indent::_(1) . " *"; - $addButton[] = Indent::_(1) . " * @since 3.2"; - $addButton[] = Indent::_(1) . " */"; - $addButton[] = Indent::_(1) . "protected function getInput()"; - $addButton[] = Indent::_(1) . "{"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " see if we should add buttons"; - $addButton[] = Indent::_(2) - . "\$set_button = \$this->getAttribute('button');"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " get html"; - $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " if true set button"; - $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; - $addButton[] = Indent::_(2) . "{"; - $addButton[] = Indent::_(3) . "\$button = array();"; - $addButton[] = Indent::_(3) . "\$script = array();"; - $addButton[] = Indent::_(3) - . "\$button_code_name = \$this->getAttribute('name');"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get the input from url"; - $addButton[] = Indent::_(3) . "\$app = JFactory::getApplication();"; - $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get the view name & id"; - $addButton[] = Indent::_(3) - . "\$values = \$jinput->getArray(array("; - $addButton[] = Indent::_(4) . "'id' => 'int',"; - $addButton[] = Indent::_(4) . "'view' => 'word'"; - $addButton[] = Indent::_(3) . "));"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " check if new item"; - $addButton[] = Indent::_(3) . "\$ref = '';"; - $addButton[] = Indent::_(3) . "\$refJ = '';"; - if ($refLoad) - { - $addButton[] = Indent::_(3) - . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " only load referral if not new item."; - $addButton[] = Indent::_(4) - . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = Indent::_(4) - . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " get the return value."; - $addButton[] = Indent::_(4) - . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = Indent::_(4) - . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " load return value."; - $addButton[] = Indent::_(4) - . "\$ref .= '&return=' . \$_return;"; - $addButton[] = Indent::_(4) - . "\$refJ .= '&return=' . \$_return;"; - $addButton[] = Indent::_(3) . "}"; - } - else - { - $addButton[] = Indent::_(3) - . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " only load field details if not new item."; - $addButton[] = Indent::_(4) - . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = Indent::_(4) - . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " get the return value."; - $addButton[] = Indent::_(4) - . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = Indent::_(4) - . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " load return value."; - $addButton[] = Indent::_(4) - . "\$ref = '&return=' . \$_return;"; - $addButton[] = Indent::_(4) - . "\$refJ = '&return=' . \$_return;"; - $addButton[] = Indent::_(3) . "}"; - } - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get button label"; - $addButton[] = Indent::_(3) - . "\$button_label = trim(\$button_code_name);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = ucfirst(strtolower(\$button_label));"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get user object"; - $addButton[] = Indent::_(3) . "\$user = JFactory::getUser();"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " only add if user allowed to create " . $fieldData['view']; - // check if the item has permissions. - $addButton[] = Indent::_(3) . "if (\$user->authorise('" - . $this->permission->getGlobal($fieldData['view'], 'core.create') - . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build Create button"; - $addButton[] = Indent::_(4) - . "\$button[] = 'config->lang_prefix - . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; - $addButton[] = Indent::_(5) . "href=\"index.php?option=" - . $fieldData['component'] . "&view=" . $fieldData['view'] - . "&layout=edit'.\$ref.'\" >"; - $addButton[] = Indent::_(5) - . "';"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " only add if user allowed to edit " . $fieldData['view']; - // check if the item has permissions. - $addButton[] = Indent::_(3) . "if (\$user->authorise('" - . $this->permission->getGlobal($fieldData['view'], 'core.edit') - . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build edit button"; - $addButton[] = Indent::_(4) - . "\$button[] = 'config->lang_prefix - . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; - $addButton[] = Indent::_(5) - . "';"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build script"; - $addButton[] = Indent::_(4) . "\$script[] = \""; - $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {"; - $addButton[] = Indent::_(6) - . "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {"; - $addButton[] = Indent::_(7) . "e.preventDefault();"; - $addButton[] = Indent::_(7) - . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = Indent::_(7) - . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = Indent::_(6) . "});"; - $addButton[] = Indent::_(6) - . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = Indent::_(6) - . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = Indent::_(5) . "});"; - $addButton[] = Indent::_(5) - . "function \".\$button_code_name.\"Button(value) {"; - $addButton[] = Indent::_(6) - . "if (value > 0) {"; // TODO not ideal since value may not be an (int) - $addButton[] = Indent::_(7) . "// hide the create button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Create').hide();"; - $addButton[] = Indent::_(7) . "// show edit button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').show();"; - $addButton[] = Indent::_(7) . "var url = 'index.php?option=" - . $fieldData['component'] . "&view=" . $fieldData['views'] - . "&task=" . $fieldData['view'] - . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);"; - $addButton[] = Indent::_(6) . "} else {"; - $addButton[] = Indent::_(7) . "// show the create button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Create').show();"; - $addButton[] = Indent::_(7) . "// hide edit button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').hide();"; - $addButton[] = Indent::_(6) . "}"; - $addButton[] = Indent::_(5) . "}\";"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " check if button was created for " . $fieldData['view'] - . " field."; - $addButton[] = Indent::_(3) - . "if (is_array(\$button) && count(\$button) > 0)"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " Load the needed script."; - $addButton[] = Indent::_(4) - . "\$document = JFactory::getDocument();"; - $addButton[] = Indent::_(4) - . "\$document->addScriptDeclaration(implode(' ',\$script));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " return the button attached to input field."; - $addButton[] = Indent::_(4) - . "return '
' .\$html . implode('',\$button).'
';"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(2) . "}"; - $addButton[] = Indent::_(2) . "return \$html;"; - $addButton[] = Indent::_(1) . "}"; - - return implode(PHP_EOL, $addButton); - } - - return ''; - } + public function get(array $fieldData): string; } diff --git a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.power b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.power index 4ec7fcc..6a4904b 100644 --- a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.power +++ b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.power @@ -1,44 +1,3 @@ - /** - * The Config Class. - * - * @var Config - * @since 3.2.0 - */ - protected Config $config; - - /** - * The Placeholder Class. - * - * @var Placeholder - * @since 3.2.0 - */ - protected Placeholder $placeholder; - - /** - * The Permission Class. - * - * @var Permission - * @since 3.2.0 - */ - protected Permission $permission; - - /** - * Constructor. - * - * @param Config $config The Config Class. - * @param Placeholder $placeholder The Placeholder Class. - * @param Permission $permission The Permission Class. - * - * @since 3.2.0 - */ - public function __construct(Config $config, Placeholder $placeholder, - Permission $permission) - { - $this->config = $config; - $this->placeholder = $placeholder; - $this->permission = $permission; - } - /** * get Add Button To List Field Input (getInput tweak) * @@ -47,260 +6,4 @@ * @return string of getInput class on success empty string otherwise * @since 3.2.0 */ - public function get(array $fieldData): string - { - // make sure hte view values are set - if (isset($fieldData['add_button']) - && ($fieldData['add_button'] === 'true' - || 1 == $fieldData['add_button']) - && isset($fieldData['view']) - && isset($fieldData['views']) - && StringHelper::check($fieldData['view']) - && StringHelper::check($fieldData['views'])) - { - // set local component - $local_component = "com_" . $this->config->component_code_name; - // check that the component value is set - if (!isset($fieldData['component']) - || !StringHelper::check( - $fieldData['component'] - )) - { - $fieldData['component'] = $local_component; - } - // check that the component has the com_ value in it - if (strpos((string) $fieldData['component'], 'com_') === false - || strpos((string) $fieldData['component'], '=') !== false) - { - $fieldData['component'] = "com_" . $fieldData['component']; - } - // make sure the component is update if # # # or [ [ [ component placeholder is used - if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false - || strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but - { - $fieldData['component'] = $this->placeholder->update_( - $fieldData['component'] - ); - } - // get core permissions - $coreLoad = false; - // add ref tags - $refLoad = true; - // fall back on the field component - $component = $fieldData['component']; - // check if we should add ref tags (since it only works well on local views) - if ($local_component !== $component) - { - // do not add ref tags - $refLoad = false; - } - // start building the add buttons/s - $addButton = array(); - $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; - $addButton[] = Indent::_(1) . " * Override to add new button"; - $addButton[] = Indent::_(1) . " *"; - $addButton[] = Indent::_(1) - . " * @return string The field input markup."; - $addButton[] = Indent::_(1) . " *"; - $addButton[] = Indent::_(1) . " * @since 3.2"; - $addButton[] = Indent::_(1) . " */"; - $addButton[] = Indent::_(1) . "protected function getInput()"; - $addButton[] = Indent::_(1) . "{"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " see if we should add buttons"; - $addButton[] = Indent::_(2) - . "\$set_button = \$this->getAttribute('button');"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " get html"; - $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; - $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) - . " if true set button"; - $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; - $addButton[] = Indent::_(2) . "{"; - $addButton[] = Indent::_(3) . "\$button = array();"; - $addButton[] = Indent::_(3) . "\$script = array();"; - $addButton[] = Indent::_(3) - . "\$button_code_name = \$this->getAttribute('name');"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get the input from url"; - $addButton[] = Indent::_(3) . "\$app = JFactory::getApplication();"; - $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get the view name & id"; - $addButton[] = Indent::_(3) - . "\$values = \$jinput->getArray(array("; - $addButton[] = Indent::_(4) . "'id' => 'int',"; - $addButton[] = Indent::_(4) . "'view' => 'word'"; - $addButton[] = Indent::_(3) . "));"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " check if new item"; - $addButton[] = Indent::_(3) . "\$ref = '';"; - $addButton[] = Indent::_(3) . "\$refJ = '';"; - if ($refLoad) - { - $addButton[] = Indent::_(3) - . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " only load referral if not new item."; - $addButton[] = Indent::_(4) - . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = Indent::_(4) - . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " get the return value."; - $addButton[] = Indent::_(4) - . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = Indent::_(4) - . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " load return value."; - $addButton[] = Indent::_(4) - . "\$ref .= '&return=' . \$_return;"; - $addButton[] = Indent::_(4) - . "\$refJ .= '&return=' . \$_return;"; - $addButton[] = Indent::_(3) . "}"; - } - else - { - $addButton[] = Indent::_(3) - . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " only load field details if not new item."; - $addButton[] = Indent::_(4) - . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = Indent::_(4) - . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " get the return value."; - $addButton[] = Indent::_(4) - . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = Indent::_(4) - . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " load return value."; - $addButton[] = Indent::_(4) - . "\$ref = '&return=' . \$_return;"; - $addButton[] = Indent::_(4) - . "\$refJ = '&return=' . \$_return;"; - $addButton[] = Indent::_(3) . "}"; - } - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get button label"; - $addButton[] = Indent::_(3) - . "\$button_label = trim(\$button_code_name);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; - $addButton[] = Indent::_(3) - . "\$button_label = ucfirst(strtolower(\$button_label));"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " get user object"; - $addButton[] = Indent::_(3) . "\$user = JFactory::getUser();"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " only add if user allowed to create " . $fieldData['view']; - // check if the item has permissions. - $addButton[] = Indent::_(3) . "if (\$user->authorise('" - . $this->permission->getGlobal($fieldData['view'], 'core.create') - . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build Create button"; - $addButton[] = Indent::_(4) - . "\$button[] = 'config->lang_prefix - . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; - $addButton[] = Indent::_(5) . "href=\"index.php?option=" - . $fieldData['component'] . "&view=" . $fieldData['view'] - . "&layout=edit'.\$ref.'\" >"; - $addButton[] = Indent::_(5) - . "';"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " only add if user allowed to edit " . $fieldData['view']; - // check if the item has permissions. - $addButton[] = Indent::_(3) . "if (\$user->authorise('" - . $this->permission->getGlobal($fieldData['view'], 'core.edit') - . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build edit button"; - $addButton[] = Indent::_(4) - . "\$button[] = 'config->lang_prefix - . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; - $addButton[] = Indent::_(5) - . "';"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " build script"; - $addButton[] = Indent::_(4) . "\$script[] = \""; - $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {"; - $addButton[] = Indent::_(6) - . "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {"; - $addButton[] = Indent::_(7) . "e.preventDefault();"; - $addButton[] = Indent::_(7) - . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = Indent::_(7) - . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = Indent::_(6) . "});"; - $addButton[] = Indent::_(6) - . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = Indent::_(6) - . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = Indent::_(5) . "});"; - $addButton[] = Indent::_(5) - . "function \".\$button_code_name.\"Button(value) {"; - $addButton[] = Indent::_(6) - . "if (value > 0) {"; // TODO not ideal since value may not be an (int) - $addButton[] = Indent::_(7) . "// hide the create button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Create').hide();"; - $addButton[] = Indent::_(7) . "// show edit button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').show();"; - $addButton[] = Indent::_(7) . "var url = 'index.php?option=" - . $fieldData['component'] . "&view=" . $fieldData['views'] - . "&task=" . $fieldData['view'] - . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);"; - $addButton[] = Indent::_(6) . "} else {"; - $addButton[] = Indent::_(7) . "// show the create button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Create').show();"; - $addButton[] = Indent::_(7) . "// hide edit button"; - $addButton[] = Indent::_(7) - . "jQuery('#\".\$button_code_name.\"Edit').hide();"; - $addButton[] = Indent::_(6) . "}"; - $addButton[] = Indent::_(5) . "}\";"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) - . " check if button was created for " . $fieldData['view'] - . " field."; - $addButton[] = Indent::_(3) - . "if (is_array(\$button) && count(\$button) > 0)"; - $addButton[] = Indent::_(3) . "{"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " Load the needed script."; - $addButton[] = Indent::_(4) - . "\$document = JFactory::getDocument();"; - $addButton[] = Indent::_(4) - . "\$document->addScriptDeclaration(implode(' ',\$script));"; - $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) - . " return the button attached to input field."; - $addButton[] = Indent::_(4) - . "return '
' .\$html . implode('',\$button).'
';"; - $addButton[] = Indent::_(3) . "}"; - $addButton[] = Indent::_(2) . "}"; - $addButton[] = Indent::_(2) . "return \$html;"; - $addButton[] = Indent::_(1) . "}"; - - return implode(PHP_EOL, $addButton); - } - - return ''; - } \ No newline at end of file + public function get(array $fieldData): string; \ No newline at end of file diff --git a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json index 258665d..cd0ffa3 100644 --- a/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json +++ b/src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json @@ -5,49 +5,12 @@ "guid": "c600f58c-3fe2-4d2d-b711-2660eab6effe", "implements": null, "load_selection": null, - "name": "InputButton", + "name": "InputButtonInterface", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Field.InputButton", - "type": "final class", - "use_selection": { - "use_selection0": { - "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", - "as": "default" - }, - "use_selection1": { - "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", - "as": "default" - }, - "use_selection2": { - "use": "7f01622a-74c9-4e67-b111-3eb488035206", - "as": "default" - }, - "use_selection3": { - "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", - "as": "default" - }, - "use_selection4": { - "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", - "as": "default" - }, - "use_selection5": { - "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", - "as": "default" - }, - "use_selection6": { - "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", - "as": "default" - }, - "use_selection7": { - "use": "0", - "as": "default" - }, - "use_selection8": { - "use": "0", - "as": "default" - } - }, - "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.InputButton", + "system_name": "JCB.Interfaces.Field.InputButtonInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Field.InputButtonInterface", "description": "Compiler Field Input Button\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md new file mode 100644 index 0000000..272a4ce --- /dev/null +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class CoreField (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour** +```uml +@startuml +class CoreField #Gold { + # array $fields + # array $paths + + __construct() + + get(bool $lowercase = false) : array + - set(string $path) : void +} + +note right of CoreField::__construct + Constructor + + since: 3.2.0 +end note + +note right of CoreField::get + Get the Array of Existing Validation Field Names + + since: 3.2.0 + return: array +end note + +note right of CoreField::set + Set the fields found in a path + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php new file mode 100644 index 0000000..f0b3803 --- /dev/null +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php @@ -0,0 +1,129 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour; + + +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface; + + +/** + * Core Joomla Fields + * + * @since 3.2.0 + */ +class CoreField implements CoreFieldInterface +{ + /** + * Local Core Joomla Fields + * + * @var array|null + * @since 3.2.0 + **/ + protected array $fields = []; + + /** + * Local Core Joomla Fields Path + * + * @var array + * @since 3.2.0 + **/ + protected array $paths = []; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation fields + $this->paths[] = JPATH_LIBRARIES . '/src/Form/Field'; + } + + /** + * Get the Array of Existing Validation Field Names + * + * @param bool $lowercase Switch to set fields lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->fields === []) + { + // check if the path exist + foreach ($this->paths as $path) + { + $this->set($path); + } + } + + // return fields if found + if ($this->fields !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->fields + ); + } + + return $this->fields; + } + + // return empty array + return []; + } + + /** + * Set the fields found in a path + * + * @param string $path The path to load fields from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $fields = Folder::files($path, '\.php$', true, true); + + // Process the files to extract field names + $processedFields = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Field.php' if it exists or just '.php' otherwise + if (substr($fileName, -9) === 'Field.php') + { + return str_replace('Field.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $fields); + + // Merge with existing fields and remove duplicates + $this->fields = array_unique(array_merge($processedFields, $this->fields)); + } +} + diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.power b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.power new file mode 100644 index 0000000..49049dc --- /dev/null +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.power @@ -0,0 +1,101 @@ + /** + * Local Core Joomla Fields + * + * @var array|null + * @since 3.2.0 + **/ + protected array $fields = []; + + /** + * Local Core Joomla Fields Path + * + * @var array + * @since 3.2.0 + **/ + protected array $paths = []; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation fields + $this->paths[] = JPATH_LIBRARIES . '/src/Form/Field'; + } + + /** + * Get the Array of Existing Validation Field Names + * + * @param bool $lowercase Switch to set fields lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->fields === []) + { + // check if the path exist + foreach ($this->paths as $path) + { + $this->set($path); + } + } + + // return fields if found + if ($this->fields !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->fields + ); + } + + return $this->fields; + } + + // return empty array + return []; + } + + /** + * Set the fields found in a path + * + * @param string $path The path to load fields from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $fields = Folder::files($path, '\.php$', true, true); + + // Process the files to extract field names + $processedFields = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Field.php' if it exists or just '.php' otherwise + if (substr($fileName, -9) === 'Field.php') + { + return str_replace('Field.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $fields); + + // Merge with existing fields and remove duplicates + $this->fields = array_unique(array_merge($processedFields, $this->fields)); + } \ No newline at end of file diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json new file mode 100644 index 0000000..2e363fb --- /dev/null +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "c6818275-cdf7-4fce-a365-90d95a77a71c", + "implements": [ + "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900" + ], + "load_selection": null, + "name": "CoreField", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J4.CoreField", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFour.CoreField", + "description": "Core Joomla Fields\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Filesystem\\Folder;", + "composer": "" +} \ No newline at end of file diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md index 4a8a979..91725dd 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md @@ -12,19 +12,26 @@ @startuml class Field #Gold { # $targetVersion + # $currentVersion + register(Container $container) : void - + getField(Container $container) : CompilerField + + getCompilerField(Container $container) : CompilerField + getData(Container $container) : Data + getGroups(Container $container) : Groups + getAttributes(Container $container) : Attributes - + getValidation(Container $container) : Validation - + getJ3CoreValidation(Container $container) : J3CoreValidation - + getCoreValidation(Container $container) : CoreValidationInterface + + getName(Container $container) : Name + + getTypeName(Container $container) : TypeName + + getUniqueName(Container $container) : UniqueName + + getRule(Container $container) : Rule + getCustomcode(Container $container) : Customcode - + getFieldName(Container $container) : Name - + getFieldTypeName(Container $container) : TypeName - + getFieldUniqueName(Container $container) : UniqueName - + getFieldDatabaseName(Container $container) : DatabaseName + + getDatabaseName(Container $container) : DatabaseName + + getJ3CoreRule(Container $container) : J3CoreRule + + getJ4CoreRule(Container $container) : J4CoreRule + + getJ3CoreField(Container $container) : J3CoreField + + getJ4CoreField(Container $container) : J4CoreField + + getJ3InputButton(Container $container) : J3InputButton + + getJ4InputButton(Container $container) : J4InputButton + + getCoreField(Container $container) : CoreField + + getCoreRule(Container $container) : CoreRule + getInputButton(Container $container) : InputButton } @@ -35,90 +42,132 @@ note right of Field::register return: void end note -note left of Field::getField - Get the Compiler Field +note left of Field::getCompilerField + Get The Field Class. since: 3.2.0 return: CompilerField end note note right of Field::getData - Get the Compiler Field Data + Get The Data Class. since: 3.2.0 return: Data end note note left of Field::getGroups - Get the Compiler Field Groups + Get The Groups Class. since: 3.2.0 return: Groups end note note right of Field::getAttributes - Get the Compiler Field Attributes + Get The Attributes Class. since: 3.2.0 return: Attributes 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 +note left of Field::getName + Get The Name Class. since: 3.2.0 return: Name end note -note right of Field::getFieldTypeName - Get the Compiler Field Type Name +note right of Field::getTypeName + Get The TypeName Class. since: 3.2.0 return: TypeName end note -note left of Field::getFieldUniqueName - Get the Compiler Field Unique Name +note left of Field::getUniqueName + Get The UniqueName Class. since: 3.2.0 return: UniqueName end note -note right of Field::getFieldDatabaseName - Get the Compiler Field Database Name +note right of Field::getRule + Get The Rule Class. + + since: 3.2.0 + return: Rule +end note + +note left of Field::getCustomcode + Get The Customcode Class. + + since: 3.2.0 + return: Customcode +end note + +note right of Field::getDatabaseName + Get The DatabaseName Class. since: 3.2.0 return: DatabaseName end note +note left of Field::getJ3CoreRule + Get The CoreRule Class. + + since: 3.2.0 + return: J3CoreRule +end note + +note right of Field::getJ4CoreRule + Get The CoreRule Class. + + since: 3.2.0 + return: J4CoreRule +end note + +note left of Field::getJ3CoreField + Get The CoreField Class. + + since: 3.2.0 + return: J3CoreField +end note + +note right of Field::getJ4CoreField + Get The CoreField Class. + + since: 3.2.0 + return: J4CoreField +end note + +note left of Field::getJ3InputButton + Get The J3InputButton Class. + + since: 3.2.0 + return: J3InputButton +end note + +note right of Field::getJ4InputButton + Get The J4InputButton Class. + + since: 3.2.0 + return: J4InputButton +end note + +note left of Field::getCoreField + Get The CoreFieldInterface Class. + + since: 3.2.0 + return: CoreField +end note + +note right of Field::getCoreRule + Get The CoreRuleInterface Class. + + since: 3.2.0 + return: CoreRule +end note + note left of Field::getInputButton Get The InputButton Class. diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php index e3ba24d..b2b8a79 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php @@ -13,7 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; -use Joomla\DI\ServiceProviderInterface; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Field as CompilerField; use VDM\Joomla\Componentbuilder\Compiler\Field\Data; use VDM\Joomla\Componentbuilder\Compiler\Field\Groups; @@ -21,12 +22,18 @@ use VDM\Joomla\Componentbuilder\Compiler\Field\Attributes; 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\Rule; use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; -use VDM\Joomla\Componentbuilder\Compiler\Field\InputButton; -use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreValidation as J3CoreValidation; -use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton; /** @@ -44,6 +51,14 @@ class Field implements ServiceProviderInterface **/ protected $targetVersion; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + /** * Registers the service provider with a DI container. * @@ -55,7 +70,7 @@ class Field implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerField::class, 'Field') - ->share('Field', [$this, 'getField'], true); + ->share('Field', [$this, 'getCompilerField'], true); $container->alias(Data::class, 'Field.Data') ->share('Field.Data', [$this, 'getData'], true); @@ -66,43 +81,61 @@ class Field implements ServiceProviderInterface $container->alias(Attributes::class, 'Field.Attributes') ->share('Field.Attributes', [$this, 'getAttributes'], true); - $container->alias(Validation::class, 'Field.Validation') - ->share('Field.Validation', [$this, 'getValidation'], true); + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getName'], true); - $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') - ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getTypeName'], true); - $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') - ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getUniqueName'], true); + + $container->alias(Rule::class, 'Field.Rule') + ->share('Field.Rule', [$this, 'getRule'], 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); + ->share('Field.Database.Name', [$this, 'getDatabaseName'], true); + + $container->alias(J3CoreRule::class, 'J3.Field.Core.Rule') + ->share('J3.Field.Core.Rule', [$this, 'getJ3CoreRule'], true); + + $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') + ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') + ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); + + $container->alias(J4CoreField::class, 'J4.Field.Core.Field') + ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') + ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); + + $container->alias(J4InputButton::class, 'J4.Field.Input.Button') + ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + + $container->alias(CoreField::class, 'Field.Core.Field') + ->share('Field.Core.Field', [$this, 'getCoreField'], true); + + $container->alias(CoreRule::class, 'Field.Core.Rule') + ->share('Field.Core.Rule', [$this, 'getCoreRule'], true); $container->alias(InputButton::class, 'Field.Input.Button') ->share('Field.Input.Button', [$this, 'getInputButton'], true); } /** - * Get the Compiler Field + * Get The Field Class. * * @param Container $container The DI container. * * @return CompilerField * @since 3.2.0 */ - public function getField(Container $container): CompilerField + public function getCompilerField(Container $container): CompilerField { return new CompilerField( $container->get('Field.Data'), @@ -113,7 +146,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -129,12 +162,12 @@ class Field implements ServiceProviderInterface $container->get('Placeholder'), $container->get('Customcode'), $container->get('Field.Customcode'), - $container->get('Field.Validation') + $container->get('Field.Rule') ); } /** - * Get the Compiler Field Groups + * Get The Groups Class. * * @param Container $container The DI container. * @@ -147,7 +180,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Attributes + * Get The Attributes Class. * * @param Container $container The DI container. * @@ -169,57 +202,71 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Validation + * Get The Name Class. * * @param Container $container The DI container. * - * @return Validation + * @return Name * @since 3.2.0 */ - public function getValidation(Container $container): Validation + public function getName(Container $container): Name { - return new Validation( - $container->get('Registry'), - $container->get('Customcode.Gui'), + return new Name( $container->get('Placeholder'), - $container->get('Customcode'), - $container->get('Field.Core.Validation') + $container->get('Field.Unique.Name'), + $container->get('Compiler.Builder.Category.Other.Name') ); } /** - * Get the Compiler Field Joomla 3 Validation + * Get The TypeName Class. * * @param Container $container The DI container. * - * @return J3CoreValidation + * @return TypeName * @since 3.2.0 */ - public function getJ3CoreValidation(Container $container): J3CoreValidation + public function getTypeName(Container $container): TypeName { - return new J3CoreValidation(); + return new TypeName(); } /** - * Get the Compiler Field Core Validation + * Get The UniqueName Class. * * @param Container $container The DI container. * - * @return CoreValidationInterface + * @return UniqueName * @since 3.2.0 */ - public function getCoreValidation(Container $container): CoreValidationInterface + public function getUniqueName(Container $container): UniqueName { - if (empty($this->targetVersion)) - { - $this->targetVersion = $container->get('Config')->joomla_version; - } - - return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + return new UniqueName( + $container->get('Registry') + ); } /** - * Get the Compiler Field Customcode + * Get The Rule Class. + * + * @param Container $container The DI container. + * + * @return Rule + * @since 3.2.0 + */ + public function getRule(Container $container): Rule + { + return new Rule( + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Field.Core.Rule') + ); + } + + /** + * Get The Customcode Class. * * @param Container $container The DI container. * @@ -234,59 +281,14 @@ class Field implements ServiceProviderInterface } /** - * 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('Compiler.Builder.Category.Other.Name') - ); - } - - /** - * 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 + * Get The DatabaseName Class. * * @param Container $container The DI container. * * @return DatabaseName * @since 3.2.0 */ - public function getFieldDatabaseName(Container $container): DatabaseName + public function getDatabaseName(Container $container): DatabaseName { return new DatabaseName( $container->get('Compiler.Builder.Lists'), @@ -294,6 +296,128 @@ class Field implements ServiceProviderInterface ); } + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J3CoreRule + * @since 3.2.0 + */ + public function getJ3CoreRule(Container $container): J3CoreRule + { + return new J3CoreRule(); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J4CoreRule + * @since 3.2.0 + */ + public function getJ4CoreRule(Container $container): J4CoreRule + { + return new J4CoreRule(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J3CoreField + * @since 3.2.0 + */ + public function getJ3CoreField(Container $container): J3CoreField + { + return new J3CoreField(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J4CoreField + * @since 3.2.0 + */ + public function getJ4CoreField(Container $container): J4CoreField + { + return new J4CoreField(); + } + + /** + * Get The J3InputButton Class. + * + * @param Container $container The DI container. + * + * @return J3InputButton + * @since 3.2.0 + */ + public function getJ3InputButton(Container $container): J3InputButton + { + return new J3InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The J4InputButton Class. + * + * @param Container $container The DI container. + * + * @return J4InputButton + * @since 3.2.0 + */ + public function getJ4InputButton(Container $container): J4InputButton + { + return new J4InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The CoreFieldInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreField + * @since 3.2.0 + */ + public function getCoreField(Container $container): CoreField + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Field'); + } + + /** + * Get The CoreRuleInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreRule + * @since 3.2.0 + */ + public function getCoreRule(Container $container): CoreRule + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Rule'); + } + /** * Get The InputButton Class. * @@ -304,11 +428,12 @@ class Field implements ServiceProviderInterface */ public function getInputButton(Container $container): InputButton { - return new InputButton( - $container->get('Config'), - $container->get('Placeholder'), - $container->get('Compiler.Creator.Permission') - ); + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Input.Button'); } } diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power index c532ffa..fc99e07 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power @@ -6,6 +6,14 @@ **/ protected $targetVersion; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + /** * Registers the service provider with a DI container. * @@ -17,7 +25,7 @@ public function register(Container $container) { $container->alias(CompilerField::class, 'Field') - ->share('Field', [$this, 'getField'], true); + ->share('Field', [$this, 'getCompilerField'], true); $container->alias(Data::class, 'Field.Data') ->share('Field.Data', [$this, 'getData'], true); @@ -28,43 +36,61 @@ $container->alias(Attributes::class, 'Field.Attributes') ->share('Field.Attributes', [$this, 'getAttributes'], true); - $container->alias(Validation::class, 'Field.Validation') - ->share('Field.Validation', [$this, 'getValidation'], true); + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getName'], true); - $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') - ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getTypeName'], true); - $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') - ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getUniqueName'], true); + + $container->alias(Rule::class, 'Field.Rule') + ->share('Field.Rule', [$this, 'getRule'], 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); + ->share('Field.Database.Name', [$this, 'getDatabaseName'], true); + + $container->alias(J3CoreRule::class, 'J3.Field.Core.Rule') + ->share('J3.Field.Core.Rule', [$this, 'getJ3CoreRule'], true); + + $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') + ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') + ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); + + $container->alias(J4CoreField::class, 'J4.Field.Core.Field') + ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') + ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); + + $container->alias(J4InputButton::class, 'J4.Field.Input.Button') + ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + + $container->alias(CoreField::class, 'Field.Core.Field') + ->share('Field.Core.Field', [$this, 'getCoreField'], true); + + $container->alias(CoreRule::class, 'Field.Core.Rule') + ->share('Field.Core.Rule', [$this, 'getCoreRule'], true); $container->alias(InputButton::class, 'Field.Input.Button') ->share('Field.Input.Button', [$this, 'getInputButton'], true); } /** - * Get the Compiler Field + * Get The Field Class. * * @param Container $container The DI container. * * @return CompilerField * @since 3.2.0 */ - public function getField(Container $container): CompilerField + public function getCompilerField(Container $container): CompilerField { return new CompilerField( $container->get('Field.Data'), @@ -75,7 +101,7 @@ } /** - * Get the Compiler Field Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -91,12 +117,12 @@ $container->get('Placeholder'), $container->get('Customcode'), $container->get('Field.Customcode'), - $container->get('Field.Validation') + $container->get('Field.Rule') ); } /** - * Get the Compiler Field Groups + * Get The Groups Class. * * @param Container $container The DI container. * @@ -109,7 +135,7 @@ } /** - * Get the Compiler Field Attributes + * Get The Attributes Class. * * @param Container $container The DI container. * @@ -131,57 +157,71 @@ } /** - * Get the Compiler Field Validation + * Get The Name Class. * * @param Container $container The DI container. * - * @return Validation + * @return Name * @since 3.2.0 */ - public function getValidation(Container $container): Validation + public function getName(Container $container): Name { - return new Validation( - $container->get('Registry'), - $container->get('Customcode.Gui'), + return new Name( $container->get('Placeholder'), - $container->get('Customcode'), - $container->get('Field.Core.Validation') + $container->get('Field.Unique.Name'), + $container->get('Compiler.Builder.Category.Other.Name') ); } /** - * Get the Compiler Field Joomla 3 Validation + * Get The TypeName Class. * * @param Container $container The DI container. * - * @return J3CoreValidation + * @return TypeName * @since 3.2.0 */ - public function getJ3CoreValidation(Container $container): J3CoreValidation + public function getTypeName(Container $container): TypeName { - return new J3CoreValidation(); + return new TypeName(); } /** - * Get the Compiler Field Core Validation + * Get The UniqueName Class. * * @param Container $container The DI container. * - * @return CoreValidationInterface + * @return UniqueName * @since 3.2.0 */ - public function getCoreValidation(Container $container): CoreValidationInterface + public function getUniqueName(Container $container): UniqueName { - if (empty($this->targetVersion)) - { - $this->targetVersion = $container->get('Config')->joomla_version; - } - - return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + return new UniqueName( + $container->get('Registry') + ); } /** - * Get the Compiler Field Customcode + * Get The Rule Class. + * + * @param Container $container The DI container. + * + * @return Rule + * @since 3.2.0 + */ + public function getRule(Container $container): Rule + { + return new Rule( + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Field.Core.Rule') + ); + } + + /** + * Get The Customcode Class. * * @param Container $container The DI container. * @@ -196,59 +236,14 @@ } /** - * 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('Compiler.Builder.Category.Other.Name') - ); - } - - /** - * 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 + * Get The DatabaseName Class. * * @param Container $container The DI container. * * @return DatabaseName * @since 3.2.0 */ - public function getFieldDatabaseName(Container $container): DatabaseName + public function getDatabaseName(Container $container): DatabaseName { return new DatabaseName( $container->get('Compiler.Builder.Lists'), @@ -256,6 +251,128 @@ ); } + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J3CoreRule + * @since 3.2.0 + */ + public function getJ3CoreRule(Container $container): J3CoreRule + { + return new J3CoreRule(); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J4CoreRule + * @since 3.2.0 + */ + public function getJ4CoreRule(Container $container): J4CoreRule + { + return new J4CoreRule(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J3CoreField + * @since 3.2.0 + */ + public function getJ3CoreField(Container $container): J3CoreField + { + return new J3CoreField(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J4CoreField + * @since 3.2.0 + */ + public function getJ4CoreField(Container $container): J4CoreField + { + return new J4CoreField(); + } + + /** + * Get The J3InputButton Class. + * + * @param Container $container The DI container. + * + * @return J3InputButton + * @since 3.2.0 + */ + public function getJ3InputButton(Container $container): J3InputButton + { + return new J3InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The J4InputButton Class. + * + * @param Container $container The DI container. + * + * @return J4InputButton + * @since 3.2.0 + */ + public function getJ4InputButton(Container $container): J4InputButton + { + return new J4InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The CoreFieldInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreField + * @since 3.2.0 + */ + public function getCoreField(Container $container): CoreField + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Field'); + } + + /** + * Get The CoreRuleInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreRule + * @since 3.2.0 + */ + public function getCoreRule(Container $container): CoreRule + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Rule'); + } + /** * Get The InputButton Class. * @@ -266,9 +383,10 @@ */ public function getInputButton(Container $container): InputButton { - return new InputButton( - $container->get('Config'), - $container->get('Placeholder'), - $container->get('Compiler.Creator.Permission') - ); + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Input.Button'); } \ No newline at end of file diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json index 63bbd13..28dc582 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json @@ -53,22 +53,46 @@ "as": "default" }, "use_selection10": { - "use": "c600f58c-3fe2-4d2d-b711-2660eab6effe", - "as": "default" + "use": "24da9672-e47f-4bb1-b6c0-0ebfc17f0957", + "as": "J3CoreRule" }, "use_selection11": { - "use": "24da9672-e47f-4bb1-b6c0-0ebfc17f0957", - "as": "J3CoreValidation" + "use": "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb", + "as": "J4CoreRule" }, "use_selection12": { + "use": "e6683873-b74e-4b54-8466-69f8a9282033", + "as": "J3CoreField" + }, + "use_selection13": { + "use": "c6818275-cdf7-4fce-a365-90d95a77a71c", + "as": "J4CoreField" + }, + "use_selection14": { + "use": "2bc33733-e900-4a9c-8cb3-c537aa9db785", + "as": "J3InputButton" + }, + "use_selection15": { + "use": "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe", + "as": "J4InputButton" + }, + "use_selection16": { + "use": "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900", + "as": "CoreField" + }, + "use_selection17": { "use": "b9f05dc4-d23a-499a-a826-9749b81818ed", - "as": "default" + "as": "CoreRule" + }, + "use_selection18": { + "use": "c600f58c-3fe2-4d2d-b711-2660eab6effe", + "as": "InputButton" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Field", "description": "Compiler Field\r\n\r\n@since 3.2.0", "implements_custom": "ServiceProviderInterface", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", - "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;\r\nuse Joomla\\CMS\\Version;", "composer": "" } \ 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 index 4d2fc0a..694c4b8 100644 --- a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md @@ -6,34 +6,34 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class Validation (Details) +# class Rule (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** ```uml @startuml -class Validation #Gold { +class Rule #Gold { # Registry $registry + # Customcode $customcode # Gui $gui # Placeholder $placeholder - # Customcode $customcode - # CoreValidationInterface $validation - + __construct(?Registry $registry = null, ?Gui $gui = null, ...) + # CoreRule $corerule + + __construct(Registry $registry, Customcode $customcode, ...) + set(int $id, string $field) : void } -note right of Validation::__construct - Constructor +note right of Rule::__construct + Constructor. since: 3.2.0 arguments: - ?Registry $registry = null - ?Gui $gui = null - ?Placeholder $placeholder = null - ?Customcode $customcode = null - ?CoreValidationInterface $validation = null + Registry $registry + Customcode $customcode + Gui $gui + Placeholder $placeholder + CoreRule $corerule end note -note right of Validation::set +note right of Rule::set Set the validation rule since: 3.2.0 diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php index afe05dc..a563a26 100644 --- a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php @@ -12,82 +12,81 @@ 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; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; /** - * Compiler Field Validation Rules + * Compiler Field Rules * * @since 3.2.0 */ -class Validation +class Rule { /** - * Compiler registry + * The Registry Class. * - * @var Registry + * @var Registry * @since 3.2.0 */ protected Registry $registry; /** - * Compiler Gui + * The Customcode Class. * - * @var Gui - * @since 3.2.0 - */ - protected Gui $gui; - - /** - * Compiler Placeholder - * - * @var Placeholder - * @since 3.2.0 - */ - protected Placeholder $placeholder; - - /** - * Compiler Customcode - * - * @var Customcode + * @var Customcode * @since 3.2.0 */ protected Customcode $customcode; /** - * Compiler Field Core Validation + * The Gui Class. * - * @var CoreValidationInterface + * @var Gui * @since 3.2.0 */ - protected CoreValidationInterface $validation; + protected Gui $gui; /** - * Constructor + * The Placeholder Class. * - * @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. + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The CoreRuleInterface Class. + * + * @var CoreRule + * @since 3.2.0 + */ + protected CoreRule $corerule; + + /** + * Constructor. + * + * @param Registry $registry The Registry Class. + * @param Customcode $customcode The Customcode Class. + * @param Gui $gui The Gui Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param CoreRule $corerule The CoreRuleInterface Class. * * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?Gui $gui = null, ?Placeholder $placeholder = null, - ?Customcode $customcode = null, ?CoreValidationInterface $validation = null) + public function __construct(Registry $registry, Customcode $customcode, Gui $gui, + Placeholder $placeholder, CoreRule $corerule) { - $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'); + $this->registry = $registry; + $this->customcode = $customcode; + $this->gui = $gui; + $this->placeholder = $placeholder; + $this->corerule = $corerule; } /** @@ -120,7 +119,7 @@ class Validation 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))) + if (!in_array($validation_rule, (array) $this->corerule->get(true))) { // get the class methods for this rule if it exists if (($php_code = GetHelper::var( @@ -162,7 +161,6 @@ class Validation } } } - } - + } } diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.power b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.power index 84806ac..9388070 100644 --- a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.power +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.power @@ -1,62 +1,62 @@ /** - * Compiler registry + * The Registry Class. * - * @var Registry + * @var Registry * @since 3.2.0 */ protected Registry $registry; /** - * Compiler Gui + * The Customcode Class. * - * @var Gui - * @since 3.2.0 - */ - protected Gui $gui; - - /** - * Compiler Placeholder - * - * @var Placeholder - * @since 3.2.0 - */ - protected Placeholder $placeholder; - - /** - * Compiler Customcode - * - * @var Customcode + * @var Customcode * @since 3.2.0 */ protected Customcode $customcode; /** - * Compiler Field Core Validation + * The Gui Class. * - * @var CoreValidationInterface + * @var Gui * @since 3.2.0 */ - protected CoreValidationInterface $validation; + protected Gui $gui; /** - * Constructor + * The Placeholder Class. * - * @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. + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The CoreRuleInterface Class. + * + * @var CoreRule + * @since 3.2.0 + */ + protected CoreRule $corerule; + + /** + * Constructor. + * + * @param Registry $registry The Registry Class. + * @param Customcode $customcode The Customcode Class. + * @param Gui $gui The Gui Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param CoreRule $corerule The CoreRuleInterface Class. * * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?Gui $gui = null, ?Placeholder $placeholder = null, - ?Customcode $customcode = null, ?CoreValidationInterface $validation = null) + public function __construct(Registry $registry, Customcode $customcode, Gui $gui, + Placeholder $placeholder, CoreRule $corerule) { - $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'); + $this->registry = $registry; + $this->customcode = $customcode; + $this->gui = $gui; + $this->placeholder = $placeholder; + $this->corerule = $corerule; } /** @@ -89,7 +89,7 @@ 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))) + if (!in_array($validation_rule, (array) $this->corerule->get(true))) { // get the class methods for this rule if it exists if (($php_code = GetHelper::var( @@ -131,4 +131,4 @@ } } } - } + } \ No newline at end of file diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json index 30efbbf..fd3a27b 100644 --- a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json @@ -5,23 +5,11 @@ "guid": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557", "implements": null, "load_selection": null, - "name": "Validation", + "name": "Rule", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Field.Validation", + "system_name": "JCB.Compiler.Field.Rule", "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" @@ -40,11 +28,19 @@ }, "use_selection7": { "use": "b9f05dc4-d23a-499a-a826-9749b81818ed", + "as": "CoreRule" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", "as": "default" } }, - "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Validation", - "description": "Compiler Field Validation Rules\r\n\r\n@since 3.2.0", + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Rule", + "description": "Compiler Field Rules\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/c9700450-4f44-4455-bc86-6a7660daadee/README.md b/src/c9700450-4f44-4455-bc86-6a7660daadee/README.md new file mode 100644 index 0000000..283c58b --- /dev/null +++ b/src/c9700450-4f44-4455-bc86-6a7660daadee/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface AllowAddInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller** +```uml +@startuml +interface AllowAddInterface #Lavender { + + get(string $nameSingleCode) : string +} + +note right of AllowAddInterface::get + Get Allow Add Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c9700450-4f44-4455-bc86-6a7660daadee/code.php b/src/c9700450-4f44-4455-bc86-6a7660daadee/code.php new file mode 100644 index 0000000..56126a4 --- /dev/null +++ b/src/c9700450-4f44-4455-bc86-6a7660daadee/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\Architecture\Controller; + + +/** + * Controller Allow Add Interface + * + * @since 3.2.0 + */ +interface AllowAddInterface +{ + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string; +} + diff --git a/src/c9700450-4f44-4455-bc86-6a7660daadee/code.power b/src/c9700450-4f44-4455-bc86-6a7660daadee/code.power new file mode 100644 index 0000000..c7710fe --- /dev/null +++ b/src/c9700450-4f44-4455-bc86-6a7660daadee/code.power @@ -0,0 +1,9 @@ + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string; \ No newline at end of file diff --git a/src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json b/src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json new file mode 100644 index 0000000..08b7e73 --- /dev/null +++ b/src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "c9700450-4f44-4455-bc86-6a7660daadee", + "implements": null, + "load_selection": null, + "name": "AllowAddInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Architecture.Controller.AllowAdd", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Architecture.Controller.AllowAddInterface", + "description": "Controller Allow Add Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md index ec47f8b..2e3e6cf 100644 --- a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md @@ -23,6 +23,7 @@ class Data #Gold { # Libraries $libraries # Dynamicget $dynamicget # Templatelayout $templatelayout + # $db + __construct(Config $config, Customcode $customcode, ...) + get(int $id = null) : object|array|null + exists(int $id = null) : bool @@ -46,7 +47,6 @@ note right of Data::__construct Libraries $libraries Dynamicget $dynamicget Templatelayout $templatelayout - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php index 66e329d..19197bb 100644 --- a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php @@ -135,6 +135,13 @@ class Data */ protected Templatelayout $templatelayout; + /** + * The Database Class. + * + * @since 3.2.0 + */ + protected $db; + /** * Constructor. * @@ -149,7 +156,6 @@ class Data * @param Libraries $libraries The Libraries Class. * @param Dynamicget $dynamicget The Data Class. * @param Templatelayout $templatelayout The Data Class. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ @@ -157,8 +163,7 @@ class Data Placeholder $placeholder, Language $language, Field $field, Fieldname $fieldname, Filesfolders $filesfolders, Libraries $libraries, - Dynamicget $dynamicget, Templatelayout $templatelayout, - ?\JDatabaseDriver $db = null) + Dynamicget $dynamicget, Templatelayout $templatelayout) { $this->config = $config; $this->customcode = $customcode; @@ -171,7 +176,7 @@ class Data $this->libraries = $libraries; $this->dynamicget = $dynamicget; $this->templatelayout = $templatelayout; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.power b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.power index 06e72b9..1ed344b 100644 --- a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.power +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.power @@ -94,6 +94,13 @@ */ protected Templatelayout $templatelayout; + /** + * The Database Class. + * + * @since 3.2.0 + */ + protected $db; + /** * Constructor. * @@ -108,7 +115,6 @@ * @param Libraries $libraries The Libraries Class. * @param Dynamicget $dynamicget The Data Class. * @param Templatelayout $templatelayout The Data Class. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ @@ -116,8 +122,7 @@ Placeholder $placeholder, Language $language, Field $field, Fieldname $fieldname, Filesfolders $filesfolders, Libraries $libraries, - Dynamicget $dynamicget, Templatelayout $templatelayout, - ?\JDatabaseDriver $db = null) + Dynamicget $dynamicget, Templatelayout $templatelayout) { $this->config = $config; $this->customcode = $customcode; @@ -130,7 +135,7 @@ $this->libraries = $libraries; $this->dynamicget = $dynamicget; $this->templatelayout = $templatelayout; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/README.md b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/README.md new file mode 100644 index 0000000..426d3f0 --- /dev/null +++ b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CanEditState (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model** +```uml +@startuml +class CanEditState << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + + __construct(Config $config, Permission $permission) + + get(string $nameSingleCode) : string +} + +note right of CanEditState::__construct + Constructor. + + since: 3.2.0 +end note + +note right of CanEditState::get + Get Can Edit State Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php new file mode 100644 index 0000000..aab38ca --- /dev/null +++ b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php @@ -0,0 +1,108 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; + + +/** + * Model Can Edit State Class for Joomla 4 + * + * @since 3.2.0 + */ +final class CanEditState implements CanEditStateInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();"; + $allow[] = Indent::_(2) + . "\$recordId = \$record->id ?? 0;"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.state') + . "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) + . "if (!\$permission && !is_null(\$permission))"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit.state')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component + . "');"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::canEditState(\$record);"; + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.power b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.power new file mode 100644 index 0000000..f774d18 --- /dev/null +++ b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.power @@ -0,0 +1,78 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + } + + /** + * Get Can Edit State Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can edit state method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // setup the default script + $allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();"; + $allow[] = Indent::_(2) + . "\$recordId = \$record->id ?? 0;"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.state') + . "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) + . "if (!\$permission && !is_null(\$permission))"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit.state')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component + . "');"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::canEditState(\$record);"; + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json new file mode 100644 index 0000000..c9ee82b --- /dev/null +++ b/src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "cb2a82a5-aa49-4d46-b765-9b3feb118208", + "implements": [ + "600515b1-493f-4448-96fe-018e54e087c8" + ], + "load_selection": null, + "name": "CanEditState", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J4.Model.CanEditState", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFour.Model.CanEditState", + "description": "Model Can Edit State Class for Joomla 4\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md index 213314f..698f41c 100644 --- a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md @@ -13,31 +13,30 @@ class Data #Gold { # array $fields # Config $config - # EventInterface $event - # HistoryInterface $history + # Event $event + # History $history # Placeholder $placeholder # Customcode $customcode - # FieldCustomcode $fieldCustomcode - # Validation $validation - # \JDatabaseDriver $db - + __construct(?Config $config = null, ?EventInterface $event = null, ...) + # FieldCustomcode $fieldcustomcode + # Rule $rule + # $db + + __construct(Config $config, Event $event, ...) + get(int $id, ?string $singleViewName = null, ...) : ?object } note right of Data::__construct - Constructor + 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 + Config $config + Event $event + History $history + Placeholder $placeholder + Customcode $customcode + FieldCustomcode $fieldcustomcode + Rule $rule end note note right of Data::get diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php index bc52a63..f2f0b22 100644 --- a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php @@ -13,17 +13,16 @@ 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\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface as History; 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; +use VDM\Joomla\Componentbuilder\Compiler\Field\Rule; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** @@ -42,95 +41,93 @@ class Data protected array $fields; /** - * Compiler Config + * The Config Class. * - * @var Config + * @var Config * @since 3.2.0 */ protected Config $config; /** - * Compiler Event + * The EventInterface Class. * - * @var EventInterface + * @var Event * @since 3.2.0 */ - protected EventInterface $event; + protected Event $event; /** - * Compiler History + * The HistoryInterface Class. * - * @var HistoryInterface + * @var History * @since 3.2.0 */ - protected HistoryInterface $history; + protected History $history; /** - * Compiler Placeholder + * The Placeholder Class. * - * @var Placeholder + * @var Placeholder * @since 3.2.0 */ protected Placeholder $placeholder; /** - * Compiler Customcode + * The Customcode Class. * - * @var Customcode + * @var Customcode * @since 3.2.0 */ protected Customcode $customcode; /** - * Compiler Field Customcode + * The Customcode Class. * - * @var FieldCustomcode + * @var FieldCustomcode * @since 3.2.0 */ - protected FieldCustomcode $fieldCustomcode; + protected FieldCustomcode $fieldcustomcode; /** - * Compiler Field Validation + * The Rule Class. * - * @var Validation + * @var Rule * @since 3.2.0 */ - protected Validation $validation; + protected Rule $rule; /** - * 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. + * The database class. * * @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) + protected $db; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param History $history The HistoryInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Customcode $customcode The Customcode Class. + * @param FieldCustomcode $fieldcustomcode The Customcode Class. + * @param Rule $rule The Rule Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, History $history, + Placeholder $placeholder, Customcode $customcode, + FieldCustomcode $fieldcustomcode, Rule $rule) { - $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(); + $this->config = $config; + $this->event = $event; + $this->history = $history; + $this->placeholder = $placeholder; + $this->customcode = $customcode; + $this->fieldcustomcode = $fieldcustomcode; + $this->rule = $rule; + $this->db = Factory::getDbo(); } /** @@ -169,13 +166,9 @@ class Data $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) + 'jcb_ce_onBeforeQueryFieldData', [&$id, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -188,8 +181,7 @@ class Data // Trigger Event: jcb_ce_onBeforeModelFieldData $this->event->trigger( - 'jcb_ce_onBeforeModelFieldData', - array(&$context, &$field) + 'jcb_ce_onBeforeModelFieldData', [&$field] ); // adding a fix for the changed name of type to fieldtype @@ -199,7 +191,7 @@ class Data $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); + $this->rule->set($id, $field->xml); // load the type values form type params $field->properties = (isset($field->properties) @@ -301,8 +293,7 @@ class Data // Trigger Event: jcb_ce_onAfterModelFieldData $this->event->trigger( - 'jcb_ce_onAfterModelFieldData', - array(&$context, &$field) + 'jcb_ce_onAfterModelFieldData', [&$field] ); $this->fields[$id] = $field; @@ -316,14 +307,13 @@ class Data if ($id > 0 && isset($this->fields[$id])) { // update the customcode of the field - $this->fieldCustomcode->update($id, $this->fields[$id], $singleViewName, $listViewName); + $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/code.power b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.power index 0b77a60..ee94c50 100644 --- a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.power +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.power @@ -7,95 +7,93 @@ protected array $fields; /** - * Compiler Config + * The Config Class. * - * @var Config + * @var Config * @since 3.2.0 */ protected Config $config; /** - * Compiler Event + * The EventInterface Class. * - * @var EventInterface + * @var Event * @since 3.2.0 */ - protected EventInterface $event; + protected Event $event; /** - * Compiler History + * The HistoryInterface Class. * - * @var HistoryInterface + * @var History * @since 3.2.0 */ - protected HistoryInterface $history; + protected History $history; /** - * Compiler Placeholder + * The Placeholder Class. * - * @var Placeholder + * @var Placeholder * @since 3.2.0 */ protected Placeholder $placeholder; /** - * Compiler Customcode + * The Customcode Class. * - * @var Customcode + * @var Customcode * @since 3.2.0 */ protected Customcode $customcode; /** - * Compiler Field Customcode + * The Customcode Class. * - * @var FieldCustomcode + * @var FieldCustomcode * @since 3.2.0 */ - protected FieldCustomcode $fieldCustomcode; + protected FieldCustomcode $fieldcustomcode; /** - * Compiler Field Validation + * The Rule Class. * - * @var Validation + * @var Rule * @since 3.2.0 */ - protected Validation $validation; + protected Rule $rule; /** - * 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. + * The database class. * * @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) + protected $db; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param History $history The HistoryInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Customcode $customcode The Customcode Class. + * @param FieldCustomcode $fieldcustomcode The Customcode Class. + * @param Rule $rule The Rule Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, History $history, + Placeholder $placeholder, Customcode $customcode, + FieldCustomcode $fieldcustomcode, Rule $rule) { - $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(); + $this->config = $config; + $this->event = $event; + $this->history = $history; + $this->placeholder = $placeholder; + $this->customcode = $customcode; + $this->fieldcustomcode = $fieldcustomcode; + $this->rule = $rule; + $this->db = Factory::getDbo(); } /** @@ -134,13 +132,9 @@ $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) + 'jcb_ce_onBeforeQueryFieldData', [&$id, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -153,8 +147,7 @@ // Trigger Event: jcb_ce_onBeforeModelFieldData $this->event->trigger( - 'jcb_ce_onBeforeModelFieldData', - array(&$context, &$field) + 'jcb_ce_onBeforeModelFieldData', [&$field] ); // adding a fix for the changed name of type to fieldtype @@ -164,7 +157,7 @@ $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); + $this->rule->set($id, $field->xml); // load the type values form type params $field->properties = (isset($field->properties) @@ -266,8 +259,7 @@ // Trigger Event: jcb_ce_onAfterModelFieldData $this->event->trigger( - 'jcb_ce_onAfterModelFieldData', - array(&$context, &$field) + 'jcb_ce_onAfterModelFieldData', [&$field] ); $this->fields[$id] = $field; @@ -281,11 +273,11 @@ if ($id > 0 && isset($this->fields[$id])) { // update the customcode of the field - $this->fieldCustomcode->update($id, $this->fields[$id], $singleViewName, $listViewName); + $this->fieldcustomcode->update($id, $this->fields[$id], $singleViewName, $listViewName); // return the field return $this->fields[$id]; } return null; - } + } \ No newline at end of file diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json index cac0c3f..2a6e21d 100644 --- a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json @@ -11,48 +11,44 @@ "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_selection1": { "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", - "as": "default" + "as": "Event" }, - "use_selection6": { + "use_selection2": { "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", - "as": "default" + "as": "History" }, - "use_selection7": { + "use_selection3": { "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", "as": "default" }, - "use_selection8": { + "use_selection4": { "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", "as": "default" }, - "use_selection9": { + "use_selection5": { "use": "a356d103-74f3-49ca-8e4f-3bd37746f089", "as": "FieldCustomcode" }, - "use_selection10": { + "use_selection6": { "use": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557", "as": "default" + }, + "use_selection7": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection8": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection9": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Data", diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/README.md b/src/cef2815b-f72b-402a-b769-f028f676692d/README.md index 4f9f9b2..a873f12 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/README.md +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/README.md @@ -33,7 +33,7 @@ class Data #Gold { # Sql $sql # Mysqlsettings $mysqlsettings # SiteEditView $siteeditview - # \JDatabaseDriver $db + # $db + __construct(Config $config, Event $event, ...) + get(int $id) : ?object } @@ -66,7 +66,6 @@ note right of Data::__construct Sql $sql Mysqlsettings $mysqlsettings SiteEditView $siteeditview - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/code.php b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php index bda82d8..dac081e 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/code.php +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php @@ -226,10 +226,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -256,14 +255,13 @@ class Data * @param Sql $sql The Sql Class. * @param Mysqlsettings $mysqlsettings The Mysqlsettings Class. * @param SiteEditView $siteeditview The SiteEditView Class. - * @param \JDatabaseDriver|null $db The Database Class. * * @since 3.2.0 */ public function __construct(Config $config, Event $event, Placeholder $placeholder, Dispenser $dispenser, Customtabs $customtabs, Tabs $tabs, Fields $fields, History $history, Permissions $permissions, Conditions $conditions, Relations $relations, Linkedviews $linkedviews, Javascript $javascript, Css $css, Php $php, Custombuttons $custombuttons, Customimportscripts $customimportscripts, Ajax $ajax, Customalias $customalias, Sql $sql, - Mysqlsettings $mysqlsettings, SiteEditView $siteeditview, ?\JDatabaseDriver $db = null) + Mysqlsettings $mysqlsettings, SiteEditView $siteeditview) { $this->config = $config; $this->event = $event; @@ -287,7 +285,7 @@ class Data $this->sql = $sql; $this->mysqlsettings = $mysqlsettings; $this->siteeditview = $siteeditview; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -357,12 +355,9 @@ class Data $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) + 'jcb_ce_onBeforeQueryViewData', [&$id, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -423,16 +418,10 @@ class Data $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) + 'jcb_ce_onBeforeModelViewData', [&$view] ); - unset($placeholders); // add the tables $view->addtables = (isset($view->addtables) @@ -502,13 +491,9 @@ class Data // 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) + 'jcb_ce_onAfterModelViewData', [&$view] ); // clear placeholders diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/code.power b/src/cef2815b-f72b-402a-b769-f028f676692d/code.power index d328554..96beadb 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/code.power +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/code.power @@ -177,10 +177,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor. @@ -207,14 +206,13 @@ * @param Sql $sql The Sql Class. * @param Mysqlsettings $mysqlsettings The Mysqlsettings Class. * @param SiteEditView $siteeditview The SiteEditView Class. - * @param \JDatabaseDriver|null $db The Database Class. * * @since 3.2.0 */ public function __construct(Config $config, Event $event, Placeholder $placeholder, Dispenser $dispenser, Customtabs $customtabs, Tabs $tabs, Fields $fields, History $history, Permissions $permissions, Conditions $conditions, Relations $relations, Linkedviews $linkedviews, Javascript $javascript, Css $css, Php $php, Custombuttons $custombuttons, Customimportscripts $customimportscripts, Ajax $ajax, Customalias $customalias, Sql $sql, - Mysqlsettings $mysqlsettings, SiteEditView $siteeditview, ?\JDatabaseDriver $db = null) + Mysqlsettings $mysqlsettings, SiteEditView $siteeditview) { $this->config = $config; $this->event = $event; @@ -238,7 +236,7 @@ $this->sql = $sql; $this->mysqlsettings = $mysqlsettings; $this->siteeditview = $siteeditview; - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -308,12 +306,9 @@ $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) + 'jcb_ce_onBeforeQueryViewData', [&$id, &$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -374,16 +369,10 @@ $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) + 'jcb_ce_onBeforeModelViewData', [&$view] ); - unset($placeholders); // add the tables $view->addtables = (isset($view->addtables) @@ -453,13 +442,9 @@ // 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) + 'jcb_ce_onAfterModelViewData', [&$view] ); // clear placeholders diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json index efe1c5f..322d72f 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json @@ -14,99 +14,99 @@ "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", "as": "default" }, - "use_selection2": { + "use_selection1": { "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", "as": "Event" }, - "use_selection3": { + "use_selection2": { "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", "as": "default" }, - "use_selection4": { + "use_selection3": { "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", "as": "default" }, - "use_selection5": { + "use_selection4": { "use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", "as": "default" }, - "use_selection6": { + "use_selection5": { "use": "143ac6ea-b64f-4331-9a97-31e3fce2bb69", "as": "default" }, - "use_selection7": { + "use_selection6": { "use": "e6a64c41-405e-4bbc-9722-27402c22bbea", "as": "default" }, - "use_selection8": { + "use_selection7": { "use": "6dfbf568-f3cd-4ea7-af04-6859447b5462", "as": "History" }, - "use_selection9": { + "use_selection8": { "use": "0dabc67c-abec-4541-82bf-279abd3c9be1", "as": "default" }, - "use_selection10": { + "use_selection9": { "use": "55e61314-ba10-4e2b-92dd-b44adebabce9", "as": "default" }, - "use_selection11": { + "use_selection10": { "use": "a8eb2fb1-88ed-4af8-842d-898eb915b588", "as": "default" }, - "use_selection12": { + "use_selection11": { "use": "ae1fa148-91be-4f80-89a9-69d91ba9d575", "as": "default" }, - "use_selection13": { + "use_selection12": { "use": "dfd3c893-0296-46eb-9ae4-a0348713cd8f", "as": "Javascript" }, - "use_selection14": { + "use_selection13": { "use": "e79842d3-51b7-4282-93c7-3487cd8b61ab", "as": "Css" }, - "use_selection15": { + "use_selection14": { "use": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe", "as": "Php" }, - "use_selection16": { + "use_selection15": { "use": "ebe3287d-bfa0-4519-b663-f442f4dea432", "as": "default" }, - "use_selection17": { + "use_selection16": { "use": "037c7274-fb16-455d-989a-bf1da022620b", "as": "default" }, - "use_selection18": { + "use_selection17": { "use": "4f575bd6-de97-41f8-80d6-259c8a6dd9ad", "as": "Ajax" }, - "use_selection19": { + "use_selection18": { "use": "5f8e8fa6-3793-44af-882d-9cfb209434e9", "as": "default" }, - "use_selection20": { + "use_selection19": { "use": "d4b418a7-bf9b-4768-969d-e07c36916fd2", "as": "default" }, - "use_selection21": { + "use_selection20": { "use": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e", "as": "default" }, - "use_selection22": { + "use_selection21": { "use": "abdb7d20-a15e-42d8-bd91-7b09514df7f2", "as": "default" }, - "use_selection23": { + "use_selection22": { "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", "as": "default" }, - "use_selection24": { + "use_selection23": { "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", "as": "default" }, - "use_selection25": { + "use_selection24": { "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", "as": "default" } diff --git a/src/cfdf0968-f394-4459-933c-ad1674fb1041/README.md b/src/cfdf0968-f394-4459-933c-ad1674fb1041/README.md new file mode 100644 index 0000000..8f6114b --- /dev/null +++ b/src/cfdf0968-f394-4459-933c-ad1674fb1041/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Request (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class Request << (F,LightGreen) >> #RoyalBlue { + # RequestBuilder $requestbuilder + + __construct(RequestBuilder $requestbuilder) + + set(string $view, string $field, ...) : void +} + +note right of Request::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Request::set + Set the request values + + since: 3.2.0 + return: void + + arguments: + string $view + string $field + string $search + string $target +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cfdf0968-f394-4459-933c-ad1674fb1041/code.php b/src/cfdf0968-f394-4459-933c-ad1674fb1041/code.php new file mode 100644 index 0000000..7ec05ee --- /dev/null +++ b/src/cfdf0968-f394-4459-933c-ad1674fb1041/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\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Builder\Request as RequestBuilder; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Request Creator Class + * + * @since 3.2.0 + */ +final class Request +{ + /** + * The Request Class. + * + * @var RequestBuilder + * @since 3.2.0 + */ + protected RequestBuilder $requestbuilder; + + /** + * Constructor. + * + * @param RequestBuilder $requestbuilder The Request Class. + * + * @since 3.2.0 + */ + public function __construct(RequestBuilder $requestbuilder) + { + $this->requestbuilder = $requestbuilder; + } + + /** + * Set the request values + * + * @param string $view + * @param string $field + * @param string $search + * @param string $target + * + * @since 3.2.0 + */ + public function set(string $view, string $field, string $search, string $target): void + { + $key = GetHelper::between($field, $search, '"'); + if (!StringHelper::check($key)) + { + // is not having special var + $key = $target; + // update field + $field = str_replace($search . '"', 'name="' . $key . '"', (string) $field); + } + else + { + // update field + $field = str_replace( + $search . $key . '"', 'name="' . $key . '"', (string) $field + ); + } + + // set the values needed for view requests to be made + $this->requestbuilder->set("$target.$view.$key", $field); + } +} + diff --git a/src/cfdf0968-f394-4459-933c-ad1674fb1041/code.power b/src/cfdf0968-f394-4459-933c-ad1674fb1041/code.power new file mode 100644 index 0000000..d525d66 --- /dev/null +++ b/src/cfdf0968-f394-4459-933c-ad1674fb1041/code.power @@ -0,0 +1,51 @@ + /** + * The Request Class. + * + * @var RequestBuilder + * @since 3.2.0 + */ + protected RequestBuilder $requestbuilder; + + /** + * Constructor. + * + * @param RequestBuilder $requestbuilder The Request Class. + * + * @since 3.2.0 + */ + public function __construct(RequestBuilder $requestbuilder) + { + $this->requestbuilder = $requestbuilder; + } + + /** + * Set the request values + * + * @param string $view + * @param string $field + * @param string $search + * @param string $target + * + * @since 3.2.0 + */ + public function set(string $view, string $field, string $search, string $target): void + { + $key = GetHelper::between($field, $search, '"'); + if (!StringHelper::check($key)) + { + // is not having special var + $key = $target; + // update field + $field = str_replace($search . '"', 'name="' . $key . '"', (string) $field); + } + else + { + // update field + $field = str_replace( + $search . $key . '"', 'name="' . $key . '"', (string) $field + ); + } + + // set the values needed for view requests to be made + $this->requestbuilder->set("$target.$view.$key", $field); + } \ No newline at end of file diff --git a/src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json b/src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json new file mode 100644 index 0000000..2cacbfd --- /dev/null +++ b/src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "cfdf0968-f394-4459-933c-ad1674fb1041", + "implements": null, + "load_selection": null, + "name": "Request", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.Request", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "98419ff3-6628-4539-8365-37f88378bced", + "as": "RequestBuilder" + }, + "use_selection1": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.Request", + "description": "Request Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d33b9278-c409-4aec-a047-b72f56712391/code.php b/src/d33b9278-c409-4aec-a047-b72f56712391/code.php index 567e9af..7ade065 100644 --- a/src/d33b9278-c409-4aec-a047-b72f56712391/code.php +++ b/src/d33b9278-c409-4aec-a047-b72f56712391/code.php @@ -118,7 +118,7 @@ class Extractor $js_text = []; $sc_text = []; // first get the Joomla .JText._() - if (in_array('Joomla' . '.JText._(', $lang_string_targets)) + if (in_array('Joomla' . '.JText._(', $lang_string_targets) || in_array('Joomla' . '.Text._(', $lang_string_targets)) { $js_text[] = GetHelper::allBetween( $content, "Joomla" . ".JText._('", "'" @@ -126,6 +126,12 @@ class Extractor $js_text[] = GetHelper::allBetween( $content, 'Joomla' . '.JText._("', '"' ); + $js_text[] = GetHelper::allBetween( + $content, "Joomla" . ".Text._('", "'" + ); + $js_text[] = GetHelper::allBetween( + $content, 'Joomla' . '.Text._("', '"' + ); // combine into one array $js_text = ArrayHelper::merge($js_text); // we need to add a check to insure these JavaScript lang matchup @@ -141,7 +147,7 @@ class Extractor } } // now get the JText: :script() - if (in_array('JText:' . ':script(', $lang_string_targets)) + if (in_array('JText:' . ':script(', $lang_string_targets) || in_array('Text:' . ':script(', $lang_string_targets)) { $sc_text[] = GetHelper::allBetween( $content, "JText:" . ":script('", "'" @@ -149,6 +155,12 @@ class Extractor $sc_text[] = GetHelper::allBetween( $content, 'JText:' . ':script("', '"' ); + $sc_text[] = GetHelper::allBetween( + $content, "Text:" . ":script('", "'" + ); + $sc_text[] = GetHelper::allBetween( + $content, 'Text:' . ':script("', '"' + ); // combine into one array $sc_text = ArrayHelper::merge($sc_text); // we need to add a check to insure these JavaScript lang matchup @@ -179,6 +191,7 @@ class Extractor // need some special treatment here if ($lang_string_target === 'Joomla' . '.JText._(' || $lang_string_target === 'JText:' . ':script(' + || $lang_string_target === 'Text:' . ':script(' || $lang_string_target === 'JustTEXT:' . ':_(') { continue; diff --git a/src/d33b9278-c409-4aec-a047-b72f56712391/code.power b/src/d33b9278-c409-4aec-a047-b72f56712391/code.power index 37f04b1..41496a6 100644 --- a/src/d33b9278-c409-4aec-a047-b72f56712391/code.power +++ b/src/d33b9278-c409-4aec-a047-b72f56712391/code.power @@ -89,7 +89,7 @@ $js_text = []; $sc_text = []; // first get the Joomla .JText._() - if (in_array('Joomla' . '.JText._(', $lang_string_targets)) + if (in_array('Joomla' . '.JText._(', $lang_string_targets) || in_array('Joomla' . '.Text._(', $lang_string_targets)) { $js_text[] = GetHelper::allBetween( $content, "Joomla" . ".JText._('", "'" @@ -97,6 +97,12 @@ $js_text[] = GetHelper::allBetween( $content, 'Joomla' . '.JText._("', '"' ); + $js_text[] = GetHelper::allBetween( + $content, "Joomla" . ".Text._('", "'" + ); + $js_text[] = GetHelper::allBetween( + $content, 'Joomla' . '.Text._("', '"' + ); // combine into one array $js_text = ArrayHelper::merge($js_text); // we need to add a check to insure these JavaScript lang matchup @@ -112,7 +118,7 @@ } } // now get the JText: :script() - if (in_array('JText:' . ':script(', $lang_string_targets)) + if (in_array('JText:' . ':script(', $lang_string_targets) || in_array('Text:' . ':script(', $lang_string_targets)) { $sc_text[] = GetHelper::allBetween( $content, "JText:" . ":script('", "'" @@ -120,6 +126,12 @@ $sc_text[] = GetHelper::allBetween( $content, 'JText:' . ':script("', '"' ); + $sc_text[] = GetHelper::allBetween( + $content, "Text:" . ":script('", "'" + ); + $sc_text[] = GetHelper::allBetween( + $content, 'Text:' . ':script("', '"' + ); // combine into one array $sc_text = ArrayHelper::merge($sc_text); // we need to add a check to insure these JavaScript lang matchup @@ -150,6 +162,7 @@ // need some special treatment here if ($lang_string_target === 'Joomla' . '.JText._(' || $lang_string_target === 'JText:' . ':script(' + || $lang_string_target === 'Text:' . ':script(' || $lang_string_target === 'JustTEXT:' . ':_(') { continue; diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md b/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md new file mode 100644 index 0000000..fd6f9db --- /dev/null +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class InstallScript (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour** +```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/d42e1fac-3c05-4a22-8878-2abd43019811/code.php b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php new file mode 100644 index 0000000..e5ce05f --- /dev/null +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php @@ -0,0 +1,374 @@ + + * @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\JoomlaFour; + + +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 . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.2.0 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) + . '$app = Factory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . Indent::_(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } +} + diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power new file mode 100644 index 0000000..8b6fae9 --- /dev/null +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power @@ -0,0 +1,343 @@ + /** + * 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 . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.2.0 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) + . '$app = Factory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . Indent::_(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } \ No newline at end of file diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json b/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json new file mode 100644 index 0000000..ff4f0fa --- /dev/null +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "d42e1fac-3c05-4a22-8878-2abd43019811", + "implements": [ + "2e6731ba-3a03-4836-b2c2-4e50e38cb890" + ], + "load_selection": null, + "name": "InstallScript", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Extension.JoomlaFour.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.JoomlaFour.InstallScript", + "description": "Loading the Extension Installation Script Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/README.md b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/README.md new file mode 100644 index 0000000..02264b0 --- /dev/null +++ b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsEmailHelper (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class ConfigFieldsetsEmailHelper << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Language $language + # Component $component + # ConfigFieldsets $configfieldsets + # Customfield $customfield + + __construct(Config $config, Language $language, ...) + + set(string $lang) : void + vdm_dkim() +} + +note right of ConfigFieldsetsEmailHelper::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Language $language + Component $component + ConfigFieldsets $configfieldsets + Customfield $customfield +end note + +note right of ConfigFieldsetsEmailHelper::set + Set Email Helper Config Fieldsets + + 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/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php new file mode 100644 index 0000000..f78f261 --- /dev/null +++ b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php @@ -0,0 +1,916 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Creator; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; + + +/** + * Config Fieldsets Email Helper Creator Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsEmailHelper +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + ConfigFieldsets $configfieldsets, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + } + + /** + * Set Email Helper Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->component->get('add_email_helper')) + { + // main lang prefix + $lang = $lang . ''; + + // set main lang string + $this->language->set( + $this->config->lang_target, $lang . '_MAIL_CONFIGURATION', "Mail Configuration" + ); + + $this->language->set($this->config->lang_target, $lang . '_DKIM', "DKIM"); + + // start building field set for email helper functions + $this->configfieldsets->add('component', PHP_EOL . Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"mail_configuration_custom_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_MAIL_CONFIGURATION\">"); + + // add custom Mail Configurations + if ($this->customfield->isArray('Mail Configuration')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Mail Configuration') + )); + $this->customfield->remove('Mail Configuration'); + } + else + { + // set all the laguage strings + $this->language->set( + $this->config->lang_target, $lang . '_MAILONLINE_LABEL', "Mailer Status" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAILONLINE_DESCRIPTION', + "Warning this will stop all emails from going out." + ); + $this->language->set($this->config->lang_target, $lang . '_ON', "On"); + $this->language->set($this->config->lang_target, $lang . '_OFF', "Off"); + $this->language->set( + $this->config->lang_target, $lang . '_MAILER_LABEL', "Mailer" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAILER_DESCRIPTION', + "Select what mailer you would like to use to send emails." + ); + $this->language->set($this->config->lang_target, $lang . '_GLOBAL', "Global"); + $this->language->set( + $this->config->lang_target, $lang . '_PHP_MAIL', "PHP Mail" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL', "Sendmail" + ); + $this->language->set($this->config->lang_target, $lang . '_SMTP', "SMTP"); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_LABEL', " From Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_DESCRIPTION', + "The global email address that will be used to send system email." + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_HINT', "Email Address Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_LABEL', "From Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_DESCRIPTION', + "Text displayed in the header "From:" field when sending a site email. Usually the site name." + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_HINT', "From Name Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_LABEL', " Reply to Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_DESCRIPTION', + "The global email address that will be used to set as the reply email. (leave blank for none)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_HINT', + "Email Address Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_LABEL', "Reply to Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_DESCRIPTION', + "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_HINT', "Reply Name Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_LABEL', "Sendmail Path" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_DESCRIPTION', + "Enter the path to the sendmail program directory on your host server." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPAUTH_LABEL', + "SMTP Authentication" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPAUTH_DESCRIPTION', + "Select yes if your SMTP host requires SMTP Authentication." + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPSECURE_LABEL', "SMTP Security" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPSECURE_DESCRIPTION', + "Select the security model that your SMTP server uses." + ); + $this->language->set($this->config->lang_target, $lang . '_NONE', "None"); + $this->language->set($this->config->lang_target, $lang . '_SSL', "SSL"); + $this->language->set($this->config->lang_target, $lang . '_TLS', "TLS"); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_LABEL', "SMTP Port" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_DESCRIPTION', + "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_HINT', "25" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_LABEL', "SMTP Username" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_DESCRIPTION', + "Enter the username for access to the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_HINT', "email@demo.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPASS_LABEL', "SMTP Password" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPASS_DESCRIPTION', + "Enter the password for access to the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_LABEL', "SMTP Host" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_DESCRIPTION', + "Enter the name of the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_HINT', "localhost" + ); + + // set the mailer fields + $this->configfieldsets->add('component', PHP_EOL . Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"mailonline\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAILONLINE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_MAILONLINE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"1\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"list\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"mailer\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAILER_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_MAILER_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"list_class\""); + $this->configfieldsets->add('component', Indent::_(3) . "multiple=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"WORD\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"true\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"global\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"emailfrom\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_EMAILFROM_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_EMAILFROM_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) . "validate=\"email\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add email address here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_EMAILFROM_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"fromname\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_FROMNAME_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_FROMNAME_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add some name here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_FROMNAME_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"replyto\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_EMAILREPLY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_EMAILREPLY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) . "validate=\"email\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add email address here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_EMAILREPLY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"replytoname\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_REPLYNAME_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_REPLYNAME_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add some name here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_REPLYNAME_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"sendmail\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SENDMAIL_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SENDMAIL_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"PATH\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add path to you local sendmail here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SENDMAIL_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:sendmail\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpauth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPAUTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPAUTH_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"0\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"list\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpsecure\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPSECURE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPSECURE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"list_class\""); + $this->configfieldsets->add('component', Indent::_(3) . "multiple=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"WORD\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"none\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpport\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPPORT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"25\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPPORT_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the port number of your SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPPORT_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpuser\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPUSER_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPUSER_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the username for SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPUSER_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"password\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtppass\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPPASS_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPPASS_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the password for SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtphost\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPHOST_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) + . "default=\"localhost\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPHOST_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the name of the SMTP host here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPHOST_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + + // start dkim field set + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"dkim_custom_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_DKIM\">"); + // add custom DKIM fields + if ($this->customfield->isArray('DKIM')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('DKIM') + )); + $this->customfield->remove('DKIM'); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_LABEL', "Enable DKIM" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DESCRIPTION', + "Set this option to Yes if you want to sign your emails using DKIM." + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_LABEL', "Domain" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_DESCRIPTION', + "Set the domain. Eg. domain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_HINT', "domain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_LABEL', "Selector" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_DESCRIPTION', + "Set your DKIM/DNS selector." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_HINT', "vdm" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', + "Enter your passphrase here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_LABEL', "Identity" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_DESCRIPTION', + "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_HINT', + "you@yourdomain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PRIVATE_KEY_LABEL', + "Private key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', + "set private key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', + "set public key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_NOTE_DKIM_USE_LABEL', + "Server Configuration" + ); + $this->language->set( + $this->config->lang_target, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

+" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_LABEL', "Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_DESCRIPTION', + "This is the KEY to use in the DNS record." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_HINT', "vdm._domainkey" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_LABEL', "Value" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_DESCRIPTION', + "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_HINT', + "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY" + ); + + $this->configfieldsets->add('component', PHP_EOL . Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"0\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"true\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_domain\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_DOMAIN_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_DOMAIN_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM Domain here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_DOMAIN_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_selector\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_SELECTOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"vdm\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_SELECTOR_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM/DNS selector here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_SELECTOR_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"password\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_passphrase\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PASSPHRASE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add passphrase here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_identity\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_IDENTITY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_IDENTITY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM Identity here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_IDENTITY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"textarea\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_private_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PRIVATE_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "rows=\"15\""); + $this->configfieldsets->add('component', Indent::_(3) . "cols=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"input-xxlarge span12\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"textarea\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_public_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PUBLIC_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "rows=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "cols=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"input-xxlarge span12\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"40\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add KEY here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_KEY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim_value\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_VALUE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"80\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"350\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_VALUE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add TXT record here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_VALUE_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } +} + diff --git a/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.power b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.power new file mode 100644 index 0000000..447f47c --- /dev/null +++ b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.power @@ -0,0 +1,884 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The Component Class. + * + * @var Component + * @since 3.2.0 + */ + protected Component $component; + + /** + * The ConfigFieldsets Class. + * + * @var ConfigFieldsets + * @since 3.2.0 + */ + protected ConfigFieldsets $configfieldsets; + + /** + * The ConfigFieldsetsCustomfield Class. + * + * @var Customfield + * @since 3.2.0 + */ + protected Customfield $customfield; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Language $language The Language Class. + * @param Component $component The Component Class. + * @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class. + * @param Customfield $customfield The ConfigFieldsetsCustomfield Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Language $language, Component $component, + ConfigFieldsets $configfieldsets, + Customfield $customfield) + { + $this->config = $config; + $this->language = $language; + $this->component = $component; + $this->configfieldsets = $configfieldsets; + $this->customfield = $customfield; + } + + /** + * Set Email Helper Config Fieldsets + * + * @param string $lang + * + * @since 3.2.0 + */ + public function set(string $lang): void + { + if ($this->component->get('add_email_helper')) + { + // main lang prefix + $lang = $lang . ''; + + // set main lang string + $this->language->set( + $this->config->lang_target, $lang . '_MAIL_CONFIGURATION', "Mail Configuration" + ); + + $this->language->set($this->config->lang_target, $lang . '_DKIM', "DKIM"); + + // start building field set for email helper functions + $this->configfieldsets->add('component', PHP_EOL . Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"mail_configuration_custom_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_MAIL_CONFIGURATION\">"); + + // add custom Mail Configurations + if ($this->customfield->isArray('Mail Configuration')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('Mail Configuration') + )); + $this->customfield->remove('Mail Configuration'); + } + else + { + // set all the laguage strings + $this->language->set( + $this->config->lang_target, $lang . '_MAILONLINE_LABEL', "Mailer Status" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAILONLINE_DESCRIPTION', + "Warning this will stop all emails from going out." + ); + $this->language->set($this->config->lang_target, $lang . '_ON', "On"); + $this->language->set($this->config->lang_target, $lang . '_OFF', "Off"); + $this->language->set( + $this->config->lang_target, $lang . '_MAILER_LABEL', "Mailer" + ); + $this->language->set( + $this->config->lang_target, $lang . '_MAILER_DESCRIPTION', + "Select what mailer you would like to use to send emails." + ); + $this->language->set($this->config->lang_target, $lang . '_GLOBAL', "Global"); + $this->language->set( + $this->config->lang_target, $lang . '_PHP_MAIL', "PHP Mail" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL', "Sendmail" + ); + $this->language->set($this->config->lang_target, $lang . '_SMTP', "SMTP"); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_LABEL', " From Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_DESCRIPTION', + "The global email address that will be used to send system email." + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILFROM_HINT', "Email Address Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_LABEL', "From Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_DESCRIPTION', + "Text displayed in the header "From:" field when sending a site email. Usually the site name." + ); + $this->language->set( + $this->config->lang_target, $lang . '_FROMNAME_HINT', "From Name Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_LABEL', " Reply to Email" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_DESCRIPTION', + "The global email address that will be used to set as the reply email. (leave blank for none)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_EMAILREPLY_HINT', + "Email Address Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_LABEL', "Reply to Name" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_DESCRIPTION', + "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)" + ); + $this->language->set( + $this->config->lang_target, $lang . '_REPLYNAME_HINT', "Reply Name Here" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_LABEL', "Sendmail Path" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_DESCRIPTION', + "Enter the path to the sendmail program directory on your host server." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPAUTH_LABEL', + "SMTP Authentication" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPAUTH_DESCRIPTION', + "Select yes if your SMTP host requires SMTP Authentication." + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPSECURE_LABEL', "SMTP Security" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPSECURE_DESCRIPTION', + "Select the security model that your SMTP server uses." + ); + $this->language->set($this->config->lang_target, $lang . '_NONE', "None"); + $this->language->set($this->config->lang_target, $lang . '_SSL', "SSL"); + $this->language->set($this->config->lang_target, $lang . '_TLS', "TLS"); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_LABEL', "SMTP Port" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_DESCRIPTION', + "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPORT_HINT', "25" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_LABEL', "SMTP Username" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_DESCRIPTION', + "Enter the username for access to the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPUSER_HINT', "email@demo.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPASS_LABEL', "SMTP Password" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPPASS_DESCRIPTION', + "Enter the password for access to the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_LABEL', "SMTP Host" + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_DESCRIPTION', + "Enter the name of the SMTP host." + ); + $this->language->set( + $this->config->lang_target, $lang . '_SMTPHOST_HINT', "localhost" + ); + + // set the mailer fields + $this->configfieldsets->add('component', PHP_EOL . Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"mailonline\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAILONLINE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_MAILONLINE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"1\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"list\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"mailer\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_MAILER_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_MAILER_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"list_class\""); + $this->configfieldsets->add('component', Indent::_(3) . "multiple=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"WORD\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"true\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"global\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"emailfrom\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_EMAILFROM_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_EMAILFROM_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) . "validate=\"email\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add email address here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_EMAILFROM_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"fromname\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_FROMNAME_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_FROMNAME_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add some name here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_FROMNAME_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"replyto\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_EMAILREPLY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_EMAILREPLY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) . "validate=\"email\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add email address here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_EMAILREPLY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"replytoname\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_REPLYNAME_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_REPLYNAME_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add some name here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_REPLYNAME_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp,sendmail,default\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"sendmail\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SENDMAIL_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SENDMAIL_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"PATH\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add path to you local sendmail here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SENDMAIL_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:sendmail\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpauth\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPAUTH_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPAUTH_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"0\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"list\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpsecure\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPSECURE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPSECURE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"list_class\""); + $this->configfieldsets->add('component', Indent::_(3) . "multiple=\"false\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"WORD\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"none\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpport\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPPORT_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"25\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPPORT_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"INT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the port number of your SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPPORT_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtpuser\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPUSER_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPUSER_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the username for SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPUSER_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"password\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtppass\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPPASS_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPPASS_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the password for SMTP server here.\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"smtphost\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_SMTPHOST_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) + . "default=\"localhost\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_SMTPHOST_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add the name of the SMTP host here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_SMTPHOST_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) + . "showon=\"mailer:smtp\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + + // start dkim field set + $this->configfieldsets->add('component', Indent::_(1) . "configfieldsets->add('component', Indent::_(2) + . "name=\"dkim_custom_config\""); + $this->configfieldsets->add('component', Indent::_(2) . "label=\"" . $lang + . "_DKIM\">"); + // add custom DKIM fields + if ($this->customfield->isArray('DKIM')) + { + $this->configfieldsets->add('component', implode( + "", $this->customfield->get('DKIM') + )); + $this->customfield->remove('DKIM'); + } + else + { + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_LABEL', "Enable DKIM" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DESCRIPTION', + "Set this option to Yes if you want to sign your emails using DKIM." + ); + $this->language->set($this->config->lang_target, $lang . '_YES', "Yes"); + $this->language->set($this->config->lang_target, $lang . '_NO', "No"); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_LABEL', "Domain" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_DESCRIPTION', + "Set the domain. Eg. domain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_DOMAIN_HINT', "domain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_LABEL', "Selector" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_DESCRIPTION', + "Set your DKIM/DNS selector." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_SELECTOR_HINT', "vdm" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', + "Enter your passphrase here." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_LABEL', "Identity" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_DESCRIPTION', + "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_IDENTITY_HINT', + "you@yourdomain.com" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PRIVATE_KEY_LABEL', + "Private key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', + "set private key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', + "set public key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_NOTE_DKIM_USE_LABEL', + "Server Configuration" + ); + $this->language->set( + $this->config->lang_target, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

+" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_LABEL', "Key" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_DESCRIPTION', + "This is the KEY to use in the DNS record." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_KEY_HINT', "vdm._domainkey" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_LABEL', "Value" + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_DESCRIPTION', + "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key." + ); + $this->language->set( + $this->config->lang_target, $lang . '_DKIM_VALUE_HINT', + "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY" + ); + + $this->configfieldsets->add('component', PHP_EOL . Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"radio\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"btn-group btn-group-yesno\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"0\""); + $this->configfieldsets->add('component', Indent::_(3) . "required=\"true\">"); + $this->configfieldsets->add('component', Indent::_(3) . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(3) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . "
"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_domain\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_DOMAIN_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_DOMAIN_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM Domain here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_DOMAIN_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_selector\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_SELECTOR_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "default=\"vdm\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_SELECTOR_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM/DNS selector here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_SELECTOR_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"password\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_passphrase\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PASSPHRASE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add passphrase here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_identity\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_IDENTITY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"60\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_IDENTITY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"raw\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add DKIM Identity here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_IDENTITY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"textarea\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_private_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PRIVATE_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "rows=\"15\""); + $this->configfieldsets->add('component', Indent::_(3) . "cols=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"input-xxlarge span12\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"textarea\""); + $this->configfieldsets->add('component', Indent::_(3) + . "name=\"dkim_public_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_PUBLIC_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "rows=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "cols=\"5\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) + . "class=\"input-xxlarge span12\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(3) + . "onchange=\"vdm_dkim();\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) + . ""); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim_key\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_KEY_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"40\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"150\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_KEY_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add KEY here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_KEY_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + $this->configfieldsets->add('component', Indent::_(2) . ""); + $this->configfieldsets->add('component', Indent::_(2) . "configfieldsets->add('component', Indent::_(3) . "type=\"text\""); + $this->configfieldsets->add('component', Indent::_(3) . "name=\"dkim_value\""); + $this->configfieldsets->add('component', Indent::_(3) . "label=\"" . $lang + . "_DKIM_VALUE_LABEL\""); + $this->configfieldsets->add('component', Indent::_(3) . "size=\"80\""); + $this->configfieldsets->add('component', Indent::_(3) . "maxlength=\"350\""); + $this->configfieldsets->add('component', Indent::_(3) . "description=\"" + . $lang . "_DKIM_VALUE_DESCRIPTION\""); + $this->configfieldsets->add('component', Indent::_(3) . "class=\"text_area\""); + $this->configfieldsets->add('component', Indent::_(3) . "filter=\"STRING\""); + $this->configfieldsets->add('component', Indent::_(3) + . "message=\"Error! Please add TXT record here.\""); + $this->configfieldsets->add('component', Indent::_(3) . "hint=\"" . $lang + . "_DKIM_VALUE_HINT\""); + $this->configfieldsets->add('component', Indent::_(3) . "showon=\"dkim:1\""); + $this->configfieldsets->add('component', Indent::_(2) . "/>"); + } + + // close that fieldset + $this->configfieldsets->add('component', Indent::_(1) . ""); + } + } \ No newline at end of file diff --git a/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json new file mode 100644 index 0000000..3d161d0 --- /dev/null +++ b/src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json @@ -0,0 +1,47 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "d80e58b8-8462-47c4-9dcd-380445f1c64a", + "implements": null, + "load_selection": null, + "name": "ConfigFieldsetsEmailHelper", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.ConfigFieldsetsEmailHelper", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "0a524af3-f647-4f62-a422-d7d36ebe749b", + "as": "default" + }, + "use_selection4": { + "use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "as": "Customfield" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsEmailHelper", + "description": "Config Fieldsets Email Helper Creator Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php index 8126e09..a807f5d 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php @@ -19,6 +19,7 @@ use VDM\Joomla\Componentbuilder\Service\Database; use VDM\Joomla\Componentbuilder\Compiler\Service\Model; use VDM\Joomla\Componentbuilder\Compiler\Service\Compiler; use VDM\Joomla\Componentbuilder\Compiler\Service\Event; +use VDM\Joomla\Componentbuilder\Compiler\Service\Header; use VDM\Joomla\Componentbuilder\Compiler\Service\History; use VDM\Joomla\Componentbuilder\Compiler\Service\Language; use VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder; @@ -36,6 +37,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlaplugin; use VDM\Joomla\Componentbuilder\Compiler\Service\Utilities; use VDM\Joomla\Componentbuilder\Compiler\Service\Builder; use VDM\Joomla\Componentbuilder\Compiler\Service\Creator; +use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureController; +use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureModel; use VDM\Joomla\Componentbuilder\Service\Gitea; use VDM\Joomla\Gitea\Service\Utilities as GiteaUtilities; use VDM\Joomla\Gitea\Service\Settings as GiteaSettings; @@ -146,6 +149,7 @@ abstract class Factory implements FactoryInterface ->registerServiceProvider(new Model()) ->registerServiceProvider(new Compiler()) ->registerServiceProvider(new Event()) + ->registerServiceProvider(new Header()) ->registerServiceProvider(new History()) ->registerServiceProvider(new Language()) ->registerServiceProvider(new Placeholder()) @@ -163,6 +167,8 @@ abstract class Factory implements FactoryInterface ->registerServiceProvider(new Utilities()) ->registerServiceProvider(new Builder()) ->registerServiceProvider(new Creator()) + ->registerServiceProvider(new ArchitectureController()) + ->registerServiceProvider(new ArchitectureModel()) ->registerServiceProvider(new Gitea()) ->registerServiceProvider(new GiteaUtilities()) ->registerServiceProvider(new GiteaSettings()) diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power index cc87704..7ead49f 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power @@ -87,6 +87,7 @@ ->registerServiceProvider(new Model()) ->registerServiceProvider(new Compiler()) ->registerServiceProvider(new Event()) + ->registerServiceProvider(new Header()) ->registerServiceProvider(new History()) ->registerServiceProvider(new Language()) ->registerServiceProvider(new Placeholder()) @@ -104,6 +105,8 @@ ->registerServiceProvider(new Utilities()) ->registerServiceProvider(new Builder()) ->registerServiceProvider(new Creator()) + ->registerServiceProvider(new ArchitectureController()) + ->registerServiceProvider(new ArchitectureModel()) ->registerServiceProvider(new Gitea()) ->registerServiceProvider(new GiteaUtilities()) ->registerServiceProvider(new GiteaSettings()) diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json index 2fd3e3e..d4fdf1f 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json @@ -28,14 +28,18 @@ "use": "0601fee8-d51e-4af0-9ad3-b5f8700c4a45", "as": "default" }, - "use_selection5": { + "use_selection4": { "use": "ea5ed06e-72ae-4906-9167-1cc0fa32fe69", "as": "default" }, - "use_selection6": { + "use_selection5": { "use": "b94aaedb-6774-4739-a63f-8f87141a85db", "as": "default" }, + "use_selection6": { + "use": "36d49d4a-8d0e-435f-ab4c-8f247d96fd4d", + "as": "default" + }, "use_selection7": { "use": "63782f74-7b03-4745-aa40-0adf8ed4e704", "as": "default" @@ -104,47 +108,55 @@ "use": "8fdd604f-53e7-4a91-9935-afcfd2f6ac1b", "as": "default" }, + "use_selection36": { + "use": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60", + "as": "default" + }, "use_selection24": { - "use": "71acf8d6-32b8-4173-8277-eb9cda29fd64", + "use": "bbd36fbf-d905-47e8-8e67-9ea6ec734712", "as": "default" }, "use_selection25": { + "use": "71acf8d6-32b8-4173-8277-eb9cda29fd64", + "as": "default" + }, + "use_selection26": { "use": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", "as": "GiteaUtilities" }, - "use_selection26": { + "use_selection27": { "use": "f4d00907-c94a-49b7-8727-d64c1fa74cf5", "as": "GiteaSettings" }, - "use_selection27": { + "use_selection28": { "use": "3d25ea99-4f33-489a-934c-0e42027e6114", "as": "GiteaOrg" }, - "use_selection28": { + "use_selection29": { "use": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e", "as": "GiteaUser" }, - "use_selection29": { + "use_selection30": { "use": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230", "as": "GiteaRepo" }, - "use_selection30": { + "use_selection31": { "use": "808da4eb-b467-46cf-a767-e7e714f46b5a", "as": "GiteaPackage" }, - "use_selection31": { + "use_selection32": { "use": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba", "as": "GiteaIssue" }, - "use_selection32": { + "use_selection33": { "use": "be57f70f-1214-4d69-8d33-7cd4e312ff70", "as": "GiteNotifi" }, - "use_selection33": { + "use_selection34": { "use": "012af7d0-3436-4cae-b856-be49bdc39a3e", "as": "GiteaMisc" }, - "use_selection34": { + "use_selection35": { "use": "ddced4c5-667d-4559-873d-d716c17fd85b", "as": "GiteaAdmin" } diff --git a/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/README.md b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/README.md new file mode 100644 index 0000000..0ff538f --- /dev/null +++ b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AllowEdit (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller** +```uml +@startuml +class AllowEdit << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + # Dispenser $dispenser + # Category $category + # CategoryOtherName $categoryothername + + __construct(Config $config, Permission $permission, ...) + + get(string $nameSingleCode, string $nameListCode) : string +} + +note right of AllowEdit::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Permission $permission + Dispenser $dispenser + Category $category + CategoryOtherName $categoryothername +end note + +note right of AllowEdit::get + Get Allow Edit Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php new file mode 100644 index 0000000..0c5e0d5 --- /dev/null +++ b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php @@ -0,0 +1,300 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; + + +/** + * Controller Allow Edit Class for Joomla 4 + * + * @since 3.2.0 + */ +final class AllowEdit implements AllowEditInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.power b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.power new file mode 100644 index 0000000..7236a2c --- /dev/null +++ b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.power @@ -0,0 +1,267 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) + . " The record has been set. Check the record permissions."; + // check if the item has permissions. + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json new file mode 100644 index 0000000..0f4269f --- /dev/null +++ b/src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "ddf31f4b-96ba-46e7-8100-f48e1cefe533", + "implements": [ + "992a842f-1ba9-4a5c-b214-042459ffe038" + ], + "load_selection": null, + "name": "AllowEdit", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J4.Controller.AllowEdit", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection3": { + "use": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection4": { + "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFour.Controller.AllowEdit", + "description": "Controller Allow Edit Class for Joomla 4\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/README.md b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/README.md new file mode 100644 index 0000000..83079c0 --- /dev/null +++ b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CanDeleteInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model** +```uml +@startuml +interface CanDeleteInterface #Lavender { + + get(string $nameSingleCode) : string +} + +note right of CanDeleteInterface::get + Get Can Delete Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.php b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.php new file mode 100644 index 0000000..662905f --- /dev/null +++ b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/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\Architecture\Model; + + +/** + * Model Can Delete Interface + * + * @since 3.2.0 + */ +interface CanDeleteInterface +{ + /** + * Get Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string; +} + diff --git a/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.power b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.power new file mode 100644 index 0000000..38ea4b7 --- /dev/null +++ b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.power @@ -0,0 +1,9 @@ + /** + * Get Can Delete Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The can delete method code + */ + public function get(string $nameSingleCode): string; \ No newline at end of file diff --git a/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json new file mode 100644 index 0000000..f5fca28 --- /dev/null +++ b/src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91", + "implements": null, + "load_selection": null, + "name": "CanDeleteInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Architecture.Model.CanDelete", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Architecture.Model.CanDeleteInterface", + "description": "Model Can Delete Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/README.md b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/README.md new file mode 100644 index 0000000..a909391 --- /dev/null +++ b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CoreFieldInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field** +```uml +@startuml +interface CoreFieldInterface #Lavender { + + get(bool $lowercase = false) : array +} + +note right of CoreFieldInterface::get + Get the Array of Existing Core Field 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/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.php b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.php new file mode 100644 index 0000000..01f0a35 --- /dev/null +++ b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/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 Field Interface + * + * @since 3.2.0 + */ +interface CoreFieldInterface +{ + /** + * Get the Array of Existing Core Field Names + * + * @param bool $lowercase Switch to set field lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array; +} + diff --git a/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.power b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.power new file mode 100644 index 0000000..d578f73 --- /dev/null +++ b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.power @@ -0,0 +1,9 @@ + /** + * Get the Array of Existing Core Field Names + * + * @param bool $lowercase Switch to set field lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array; \ No newline at end of file diff --git a/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json new file mode 100644 index 0000000..ea5c126 --- /dev/null +++ b/src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900", + "implements": null, + "load_selection": null, + "name": "CoreFieldInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Field.CoreFieldInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Field.CoreFieldInterface", + "description": "Field Joomla Core Field Interface\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md b/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md new file mode 100644 index 0000000..2e6d4f9 --- /dev/null +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class CoreField (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree** +```uml +@startuml +class CoreField #Gold { + # array $fields + # array $paths + + __construct() + + get(bool $lowercase = false) : array + - set(string $path) : void +} + +note right of CoreField::__construct + Constructor + + since: 3.2.0 +end note + +note right of CoreField::get + Get the Array of Existing Validation Field Names + + since: 3.2.0 + return: array +end note + +note right of CoreField::set + Set the fields found in a path + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php new file mode 100644 index 0000000..f27af16 --- /dev/null +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php @@ -0,0 +1,130 @@ + + * @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\CoreFieldInterface; + + +/** + * Core Joomla Fields + * + * @since 3.2.0 + */ +class CoreField implements CoreFieldInterface +{ + /** + * Local Core Joomla Fields + * + * @var array|null + * @since 3.2.0 + **/ + protected array $fields = []; + + /** + * Local Core Joomla Fields Path + * + * @var array + * @since 3.2.0 + **/ + protected array $paths = []; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation fields + $this->paths[] = JPATH_LIBRARIES . '/src/Form/Field'; + $this->paths[] = JPATH_LIBRARIES . '/joomla/form/fields'; + } + + /** + * Get the Array of Existing Validation Field Names + * + * @param bool $lowercase Switch to set fields lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->fields === []) + { + // check if the path exist + foreach ($this->paths as $path) + { + $this->set($path); + } + } + + // return fields if found + if ($this->fields !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->fields + ); + } + + return $this->fields; + } + + // return empty array + return []; + } + + /** + * Set the fields found in a path + * + * @param string $path The path to load fields from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $fields = Folder::files($path, '\.php$', true, true); + + // Process the files to extract field names + $processedFields = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Field.php' if it exists or just '.php' otherwise + if (substr($fileName, -9) === 'Field.php') + { + return str_replace('Field.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $fields); + + // Merge with existing fields and remove duplicates + $this->fields = array_unique(array_merge($processedFields, $this->fields)); + } +} + diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/code.power b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.power new file mode 100644 index 0000000..8278ef1 --- /dev/null +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.power @@ -0,0 +1,102 @@ + /** + * Local Core Joomla Fields + * + * @var array|null + * @since 3.2.0 + **/ + protected array $fields = []; + + /** + * Local Core Joomla Fields Path + * + * @var array + * @since 3.2.0 + **/ + protected array $paths = []; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation fields + $this->paths[] = JPATH_LIBRARIES . '/src/Form/Field'; + $this->paths[] = JPATH_LIBRARIES . '/joomla/form/fields'; + } + + /** + * Get the Array of Existing Validation Field Names + * + * @param bool $lowercase Switch to set fields lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->fields === []) + { + // check if the path exist + foreach ($this->paths as $path) + { + $this->set($path); + } + } + + // return fields if found + if ($this->fields !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->fields + ); + } + + return $this->fields; + } + + // return empty array + return []; + } + + /** + * Set the fields found in a path + * + * @param string $path The path to load fields from + * @return void + * @since 3.2.0 + */ + private function set(string $path): void + { + // Check if the path exists + if (!Folder::exists($path)) + { + return; + } + + // Load all PHP files in this path + $fields = Folder::files($path, '\.php$', true, true); + + // Process the files to extract field names + $processedFields = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Field.php' if it exists or just '.php' otherwise + if (substr($fileName, -9) === 'Field.php') + { + return str_replace('Field.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $fields); + + // Merge with existing fields and remove duplicates + $this->fields = array_unique(array_merge($processedFields, $this->fields)); + } \ No newline at end of file diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json b/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json new file mode 100644 index 0000000..7ee7ad6 --- /dev/null +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "e6683873-b74e-4b54-8466-69f8a9282033", + "implements": [ + "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900" + ], + "load_selection": null, + "name": "CoreField", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J3.CoreField", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.CoreField", + "description": "Core Joomla Fields\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Filesystem\\Folder;", + "composer": "" +} \ No newline at end of file diff --git a/src/e7fff971-b031-42bf-8009-ef554e30854d/README.md b/src/e7fff971-b031-42bf-8009-ef554e30854d/README.md new file mode 100644 index 0000000..db54510 --- /dev/null +++ b/src/e7fff971-b031-42bf-8009-ef554e30854d/README.md @@ -0,0 +1,209 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Settings (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour** +```uml +@startuml +class Settings << (F,LightGreen) >> #RoyalBlue { + # array $standardFolders + # array $standardRootFiles + # ?object $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Component $component + # Paths $paths + # Dynamicpath $dynamicpath + # Pathfix $pathfix + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + exists() : bool + + structure() : object + + multiple() : object + + single() : object + + standardFolder(string $folder) : bool + + standardRootFile(string $file) : bool + - isSet() : bool + - get() : ?object + - readJsonFile(string $filePath) : ?object + - isValidData(object $versionData) : bool + - loadExtraFolders() : void + - addImportViewFolder() : void + - addPhpSpreadsheetFolder() : void + - addUikitFolder() : void + - addFooTableFolder() : void + - loadExtraFiles() : void + - addGoogleChartFiles() : void + - addFolders(object $versionData) : void + - addFiles(object $versionData) : void +} + +note right of Settings::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Placeholder $placeholder = null + ?Component $component = null + ?Paths $paths = null + ?Dynamicpath $dynamicpath = null + ?Pathfix $pathfix = null +end note + +note left of Settings::exists + Check if data set is loaded + + since: 3.2.0 + return: bool +end note + +note right of Settings::structure + Get Joomla - Folder Structure to Create + + since: 3.2.0 + return: object +end note + +note left of Settings::multiple + Get Joomla - Move Multiple Structure + + since: 3.2.0 + return: object +end note + +note right of Settings::single + Get Joomla - Move Single Structure + + since: 3.2.0 + return: object +end note + +note left of Settings::standardFolder + Check if Folder is a Standard Folder + + since: 3.2.0 + return: bool +end note + +note right of Settings::standardRootFile + Check if File is a Standard Root File + + since: 3.2.0 + return: bool +end note + +note left of Settings::isSet + Check if Data is Set + + since: 3.2.0 + return: bool +end note + +note right of Settings::get + get the Joomla Version Data + + since: 3.2.0 + return: ?object +end note + +note left of Settings::readJsonFile + Read the Json file data + + since: 3.2.0 + return: ?object +end note + +note right of Settings::isValidData + Check if this is valid data + + since: 3.2.0 + return: bool +end note + +note left of Settings::loadExtraFolders + Add Extra/Dynamic folders + + since: 3.2.0 + return: void +end note + +note right of Settings::addImportViewFolder + Add Import and Export Folder + + since: 3.2.0 + return: void +end note + +note left of Settings::addPhpSpreadsheetFolder + Add Php Spreadsheet Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::addUikitFolder + Add Uikit Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFooTableFolder + Add Foo Table Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::loadExtraFiles + Add Extra/Dynamic files + + since: 3.2.0 + return: void +end note + +note left of Settings::addGoogleChartFiles + Add Google Chart Files + + since: 3.2.0 + return: void +end note + +note right of Settings::addFolders + Add Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFiles + Add Files + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e7fff971-b031-42bf-8009-ef554e30854d/code.php b/src/e7fff971-b031-42bf-8009-ef554e30854d/code.php new file mode 100644 index 0000000..15b9004 --- /dev/null +++ b/src/e7fff971-b031-42bf-8009-ef554e30854d/code.php @@ -0,0 +1,748 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface; + + +/** + * Compiler Component (Joomla Version) Settings + * + * @since 3.2.0 + */ +final class Settings implements SettingsInterface +{ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + // soon + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } +} + diff --git a/src/e7fff971-b031-42bf-8009-ef554e30854d/code.power b/src/e7fff971-b031-42bf-8009-ef554e30854d/code.power new file mode 100644 index 0000000..94e562f --- /dev/null +++ b/src/e7fff971-b031-42bf-8009-ef554e30854d/code.power @@ -0,0 +1,710 @@ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + // soon + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } \ No newline at end of file diff --git a/src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json b/src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json new file mode 100644 index 0000000..bb0a51c --- /dev/null +++ b/src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "e7fff971-b031-42bf-8009-ef554e30854d", + "implements": [ + "5f44e66a-31d0-45ff-92b3-b7372dc57ae9" + ], + "load_selection": null, + "name": "Settings", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.J4.Settings", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection6": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection7": { + "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "as": "default" + }, + "use_selection8": { + "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "as": "default" + }, + "use_selection9": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection10": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection11": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.JoomlaFour.Settings", + "description": "Compiler Component (Joomla Version) Settings\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/README.md b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/README.md new file mode 100644 index 0000000..a2970c9 --- /dev/null +++ b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ConfigFieldsetsCustomfield (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class ConfigFieldsetsCustomfield << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.php b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.php new file mode 100644 index 0000000..19f10f9 --- /dev/null +++ b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/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\Builder; + + +use VDM\Joomla\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Config Field Sets Custom Field Builder Class + * + * @since 3.2.0 + */ +final class ConfigFieldsetsCustomfield extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; +} + diff --git a/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.power b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.power new file mode 100644 index 0000000..941fce3 --- /dev/null +++ b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.power @@ -0,0 +1,6 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; \ No newline at end of file diff --git a/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json new file mode 100644 index 0000000..a777f30 --- /dev/null +++ b/src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "ConfigFieldsetsCustomfield", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.ConfigFieldsetsCustomfield", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.ConfigFieldsetsCustomfield", + "description": "Config Field Sets Custom Field Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md index fdd497e..8ab77a4 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md @@ -14,6 +14,7 @@ class Extension #Gold { # $targetVersion + register(Container $container) : void + getJ3ExtensionInstallScript(Container $container) : J3InstallScript + + getJ4ExtensionInstallScript(Container $container) : J4InstallScript + getExtensionInstallScript(Container $container) : GetScriptInterface } @@ -31,6 +32,13 @@ note right of Extension::getJ3ExtensionInstallScript return: J3InstallScript end note +note right of Extension::getJ4ExtensionInstallScript + Get the Joomla 4 Extension Install Script + + since: 3.2.0 + return: J4InstallScript +end note + note right of Extension::getExtensionInstallScript Get the Joomla Extension Install Script diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php index 50d751b..4eadc98 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php @@ -16,6 +16,7 @@ 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; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript; /** @@ -48,6 +49,9 @@ class Extension implements ServiceProviderInterface $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + + $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') + ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); } /** @@ -63,6 +67,19 @@ class Extension implements ServiceProviderInterface return new J3InstallScript(); } + /** + * Get the Joomla 4 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J4InstallScript + * @since 3.2.0 + */ + public function getJ4ExtensionInstallScript(Container $container): J4InstallScript + { + return new J4InstallScript(); + } + /** * Get the Joomla Extension Install Script * diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power index 41824d8..4be5e01 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power @@ -21,6 +21,9 @@ $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + + $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') + ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); } /** @@ -36,6 +39,19 @@ return new J3InstallScript(); } + /** + * Get the Joomla 4 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J4InstallScript + * @since 3.2.0 + */ + public function getJ4ExtensionInstallScript(Container $container): J4InstallScript + { + return new J4InstallScript(); + } + /** * Get the Joomla Extension Install Script * diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json index dba07a0..026cc76 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json @@ -19,6 +19,10 @@ "use_selection1": { "use": "1d929017-a5de-4e0f-9b5a-838934857e26", "as": "J3InstallScript" + }, + "use_selection2": { + "use": "d42e1fac-3c05-4a22-8878-2abd43019811", + "as": "J4InstallScript" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Extension", diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md index c105d7d..f4cf28a 100644 --- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md +++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md @@ -12,8 +12,8 @@ @startuml class Extractor << (F,LightGreen) >> #RoyalBlue { # array $powers - # \JDatabaseDriver $db - + __construct(?\JDatabaseDriver $db = null) + # $db + + __construct() + get_() : ?array + get(string $code) : ?array + reverse(string $code) : ?array diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php index b1b0c52..8dafcfb 100644 --- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php +++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php @@ -41,20 +41,18 @@ final class Extractor /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The database object. * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power index 1832fb9..539e4eb 100644 --- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power +++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power @@ -17,20 +17,18 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The database object. * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md index 83b6936..7aad8cf 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md @@ -31,7 +31,7 @@ class Data << (F,LightGreen) >> #RoyalBlue { # Updateserver $updateserver # Joomlamodules $modules # Joomlaplugins $plugins - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?EventInterface $event = null, ...) + get() : ?object } @@ -62,7 +62,6 @@ note right of Data::__construct ?Updateserver $updateserver = null ?Joomlamodules $modules = null ?Joomlaplugins $plugins = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php index e4d2927..ef6f6bc 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php @@ -210,10 +210,9 @@ final class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -249,7 +248,7 @@ final class Data ?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null, ?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null, ?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null, - ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null) + ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -271,7 +270,7 @@ final class Data $this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver'); $this->modules = $modules ?: Compiler::_('Model.Joomlamodules'); $this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -346,15 +345,9 @@ final class Data $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) + 'jcb_ce_onBeforeQueryComponentData', [&$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -371,8 +364,7 @@ final class Data // Trigger Event: jcb_ce_onBeforeModelComponentData $this->event->trigger( - 'jcb_ce_onBeforeModelComponentData', - array(&$component_context, &$component) + 'jcb_ce_onBeforeModelComponentData', [&$component] ); // load the global placeholders @@ -866,7 +858,7 @@ final class Data // Trigger Event: jcb_ce_onAfterModelComponentData $this->event->trigger( 'jcb_ce_onAfterModelComponentData', - array(&$component_context, &$component) + [&$component] ); // return found component data diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power index 8a81487..2a10c3b 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power @@ -161,10 +161,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -200,7 +199,7 @@ ?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null, ?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null, ?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null, - ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null) + ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -222,7 +221,7 @@ $this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver'); $this->modules = $modules ?: Compiler::_('Model.Joomlamodules'); $this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** @@ -297,15 +296,9 @@ $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) + 'jcb_ce_onBeforeQueryComponentData', [&$query, &$this->db] ); // Reset the query using our newly populated query object. @@ -322,8 +315,7 @@ // Trigger Event: jcb_ce_onBeforeModelComponentData $this->event->trigger( - 'jcb_ce_onBeforeModelComponentData', - array(&$component_context, &$component) + 'jcb_ce_onBeforeModelComponentData', [&$component] ); // load the global placeholders @@ -817,7 +809,7 @@ // Trigger Event: jcb_ce_onAfterModelComponentData $this->event->trigger( 'jcb_ce_onAfterModelComponentData', - array(&$component_context, &$component) + [&$component] ); // return found component data diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md index 9dc1ac6..baf85af 100644 --- a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md @@ -17,7 +17,7 @@ class Data #Gold { # Gui $gui # Loader $loader # Libraries $libraries - # \JDatabaseDriver $db + # $db + __construct(?Config $config = null, ?Registry $registry = null, ...) + get(string $alias, string $table, ...) : ?array # set(string $table) : void @@ -35,7 +35,6 @@ note right of Data::__construct ?Gui $gui = null ?Loader $loader = null ?Libraries $libraries = null - ?\JDatabaseDriver $db = null end note note right of Data::get diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php index 42bf0d3..c01caa1 100644 --- a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php @@ -82,10 +82,9 @@ class Data /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -102,8 +101,7 @@ class Data */ public function __construct(?Config $config = null, ?Registry $registry = null, ?Customcode $customcode = null, ?Gui $gui = null, - ?Loader $loader = null, ?Libraries $libraries = null, - ?\JDatabaseDriver $db = null) + ?Loader $loader = null, ?Libraries $libraries = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -111,7 +109,7 @@ class Data $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->loader = $loader ?: Compiler::_('Model.Loader'); $this->libraries = $libraries ?: Compiler::_('Model.Libraries'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.power b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.power index 172fdc7..f5cd08b 100644 --- a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.power +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.power @@ -49,10 +49,9 @@ /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -69,8 +68,7 @@ */ public function __construct(?Config $config = null, ?Registry $registry = null, ?Customcode $customcode = null, ?Gui $gui = null, - ?Loader $loader = null, ?Libraries $libraries = null, - ?\JDatabaseDriver $db = null) + ?Loader $loader = null, ?Libraries $libraries = null) { $this->config = $config ?: Compiler::_('Config'); $this->registry = $registry ?: Compiler::_('Registry'); @@ -78,7 +76,7 @@ $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->loader = $loader ?: Compiler::_('Model.Loader'); $this->libraries = $libraries ?: Compiler::_('Model.Libraries'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/src/f21388dc-5ddc-4970-a3c2-55f075024762/README.md b/src/f21388dc-5ddc-4970-a3c2-55f075024762/README.md new file mode 100644 index 0000000..de110bb --- /dev/null +++ b/src/f21388dc-5ddc-4970-a3c2-55f075024762/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AllowAdd (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller** +```uml +@startuml +class AllowAdd << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + # Dispenser $dispenser + + __construct(Config $config, Permission $permission, ...) + + get(string $nameSingleCode) : string +} + +note right of AllowAdd::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Permission $permission + Dispenser $dispenser +end note + +note right of AllowAdd::get + Get Allow Add Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php b/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php new file mode 100644 index 0000000..7bb855a --- /dev/null +++ b/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php @@ -0,0 +1,129 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface; + + +/** + * Controller Allow Add Class for Joomla 3 + * + * @since 3.2.0 + */ +final class AllowAdd implements AllowAddInterface +{ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + } + + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // prepare custom permission script + $custom_allow = $this->dispenser->get( + 'php_allowadd', $nameSingleCode, '', null, true + ); + + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.access')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Access check."; + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.access') + . "', 'com_" . $this->component . "');"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + + // load custom permission script + $allow[] = $custom_allow; + + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.create')) + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.create') + . "', \$this->option);"; + } + else + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return parent::allowAdd(\$data);"; + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.power b/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.power new file mode 100644 index 0000000..7f2eed5 --- /dev/null +++ b/src/f21388dc-5ddc-4970-a3c2-55f075024762/code.power @@ -0,0 +1,98 @@ + /** + * The Component code name. + * + * @var String + * @since 3.2.0 + */ + protected String $component; + + /** + * The Permission Class. + * + * @var Permission + * @since 3.2.0 + */ + protected Permission $permission; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + } + + /** + * Get Allow Add Function Code + * + * @param string $nameSingleCode The single code name of the view. + * + * @since 3.2.0 + * @return string The allow add method code + */ + public function get(string $nameSingleCode): string + { + $allow = []; + + // prepare custom permission script + $custom_allow = $this->dispenser->get( + 'php_allowadd', $nameSingleCode, '', null, true + ); + + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Get user object."; + $allow[] = Indent::_(2) . "\$user = Factory::getUser();"; + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.access')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Access check."; + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.access') + . "', 'com_" . $this->component . "');"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + + // load custom permission script + $allow[] = $custom_allow; + + // check if the item has permissions. + if ($this->permission->globalExist($nameSingleCode, 'core.create')) + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.create') + . "', \$this->option);"; + } + else + { + // setup the default script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " In the absence of better information, revert to the component permissions."; + $allow[] = Indent::_(2) . "return parent::allowAdd(\$data);"; + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json b/src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json new file mode 100644 index 0000000..9ff3d5d --- /dev/null +++ b/src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "f21388dc-5ddc-4970-a3c2-55f075024762", + "implements": [ + "c9700450-4f44-4455-bc86-6a7660daadee" + ], + "load_selection": null, + "name": "AllowAdd", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J3.Controller.AllowAdd", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "7f01622a-74c9-4e67-b111-3eb488035206", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection3": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection4": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaThree.Controller.AllowAdd", + "description": "Controller Allow Add Class for Joomla 3\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f34442df-c84c-44c3-9991-bbf72bffa635/README.md b/src/f34442df-c84c-44c3-9991-bbf72bffa635/README.md new file mode 100644 index 0000000..f81ebc7 --- /dev/null +++ b/src/f34442df-c84c-44c3-9991-bbf72bffa635/README.md @@ -0,0 +1,30 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class ViewsDefaultOrdering (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class ViewsDefaultOrdering << (F,LightGreen) >> #RoyalBlue { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php b/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php new file mode 100644 index 0000000..4013459 --- /dev/null +++ b/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder; + + +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Views Default Ordering Builder Class + * + * @since 3.2.0 + */ +final class ViewsDefaultOrdering extends Registry implements Registryinterface +{ +} + diff --git a/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.power b/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/f34442df-c84c-44c3-9991-bbf72bffa635/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json b/src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json new file mode 100644 index 0000000..d9d4e18 --- /dev/null +++ b/src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "f34442df-c84c-44c3-9991-bbf72bffa635", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "ViewsDefaultOrdering", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.ViewsDefaultOrdering", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.ViewsDefaultOrdering", + "description": "Views Default Ordering Builder Class\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md index 5cf05db..e066bfa 100644 --- a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md @@ -30,6 +30,8 @@ class Config #Gold { # getComponentcodename() : string # getComponentcontext() : string # getComponentcodenamelength() : int + # getAddnamespaceprefix() : bool + # getNamespaceprefix() : string # getJoomlaversion() : int # getJoomlaversions() : array # getJoomlaversionname() : string @@ -46,6 +48,7 @@ class Config #Gold { # getTidy() : bool # getSettidywarning() : bool # getSettaghistory() : bool + # getPercentagelanguageadd() : int # getLangtag() : string # getLangprefix() : string # getLangtarget() : string @@ -56,6 +59,7 @@ class Config #Gold { # getTmppath() : string # getCompilerpath() : string # getJcbpowerspath() : string + # getPowerlibraryfolder() : string # getLocalpowersrepositorypath() : string # getApprovedpaths() : array # getBompath() : string @@ -79,6 +83,8 @@ class Config #Gold { # getGooglechart() : bool # getFootable() : bool # getFootableversion() : int + # getPermissionstrictperfield() : bool + # getExporttextonly() : int } note right of Config::__construct @@ -204,6 +210,20 @@ note right of Config::getComponentcodenamelength return: int end note +note left of Config::getAddnamespaceprefix + get add namespace prefix + + since: 3.2.0 + return: bool +end note + +note right of Config::getNamespaceprefix + get namespace prefix + + since: 3.2.0 + return: string +end note + note left of Config::getJoomlaversion get posted Joomla version @@ -316,70 +336,84 @@ note right of Config::getSettaghistory return: bool end note -note left of Config::getLangtag +note left of Config::getPercentagelanguageadd + get percentage when a language should be added + + since: 3.2.0 + return: int +end note + +note right of Config::getLangtag get language tag since: 3.2.0 return: string end note -note right of Config::getLangprefix +note left of Config::getLangprefix get language prefix since: 3.2.0 return: string end note -note left of Config::getLangtarget +note right of Config::getLangtarget get language target since: 3.2.0 return: string end note -note right of Config::getLangstringtargets +note left of Config::getLangstringtargets get language string targets since: 3.2.0 return: array end note -note left of Config::getLangstringkeytargets +note right of Config::getLangstringkeytargets get language string targets (by key name) since: 3.2.0 return: array end note -note right of Config::getFieldbuildertype +note left of Config::getFieldbuildertype get field builder type since: 3.2.0 return: int end note -note left of Config::getDefaultfields +note right of Config::getDefaultfields get default fields since: 3.2.0 return: array end note -note right of Config::getTmppath +note left of Config::getTmppath get temporary path since: 3.2.0 return: string end note -note left of Config::getCompilerpath +note right of Config::getCompilerpath get compiler path since: 3.2.0 return: string end note -note right of Config::getJcbpowerspath +note left of Config::getJcbpowerspath + get jcb powers path + + since: 3.2.0 + return: string +end note + +note right of Config::getPowerlibraryfolder get jcb powers path since: 3.2.0 @@ -546,6 +580,20 @@ note left of Config::getFootableversion since: 3.2.0 return: int end note + +note right of Config::getPermissionstrictperfield + The Permission Strict Per Field Switch + + since: 3.2.0 + return: bool +end note + +note left of Config::getExporttextonly + The Export Text Only Switch + + since: 3.2.0 + return: int +end note @enduml ``` diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php index 4759597..3e905ee 100644 --- a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php @@ -293,6 +293,42 @@ class Config extends BaseConfig return strlen((string) $this->component_code_name); } + /** + * get add namespace prefix + * + * @return bool The add namespace prefix switch + * @since 3.2.0 + */ + protected function getAddnamespaceprefix(): bool + { + // get components override switch + $value = GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'add_namespace_prefix' + ); + + return $value == 1 ? true : false; + } + + /** + * get namespace prefix + * + * @return string The namespace prefix + * @since 3.2.0 + */ + protected function getNamespaceprefix(): string + { + // load based on component settings + $prefix = null; + if ($this->add_namespace_prefix) + { + $prefix = GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'namespace_prefix' + ); + } + + return $prefix ?? $this->params->get('namespace_prefix', 'JCB'); + } + /** * get posted Joomla version * @@ -301,7 +337,7 @@ class Config extends BaseConfig */ protected function getJoomlaversion(): int { - return 3; // $this->input->post->get('joomla_version', 3, 'INT'); + return $this->input->post->get('joomla_version', 3, 'INT'); } /** @@ -313,8 +349,8 @@ class Config extends BaseConfig 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 + 3 => ['folder_key' => 3, 'xml_version' => '3.10'], + 4 => ['folder_key' => 4, 'xml_version' => '4.0'] ]; } @@ -524,6 +560,18 @@ class Config extends BaseConfig return true; } + /** + * get percentage when a language should be added + * + * @return int The percentage value + * @since 3.2.0 + */ + protected function getPercentagelanguageadd(): int + { + // get the global language + return $this->params->get('percentagelanguageadd', 50); + } + /** * get language tag * @@ -586,7 +634,7 @@ class Config extends BaseConfig // these strings are used to search for language strings in all content return [ 'jjt' => 'Joomla' . '.JText._(', - 'js' => 'JText:' . ':script(', + 'js' => 'Text:' . ':script(', 't' => 'Text:' . ':_(', // namespace and J version will be found 'ts' => 'Text:' . ':sprintf(', // namespace and J version will be found 'jt' => 'JustTEXT:' . ':_(' @@ -659,6 +707,18 @@ class Config extends BaseConfig return $this->params->get('jcb_powers_path', 'libraries/jcb_powers'); } + /** + * get jcb powers path + * + * @return string The jcb powers path + * @since 3.2.0 + */ + protected function getPowerlibraryfolder(): string + { + // get power library folder path + return trim(str_replace('libraries/', '', $this->jcb_powers_path), '/'); + } + /** * Get local super powers repository path * @@ -1005,6 +1065,28 @@ class Config extends BaseConfig protected function getFootableversion(): int { return 2; // default is version 2 + } + + /** + * The Permission Strict Per Field Switch + * + * @return bool Switch to control the Strict Permission Per/Field + * @since 3.2.0 + */ + protected function getPermissionstrictperfield(): bool + { + return false; + } + + /** + * The Export Text Only Switch + * + * @return int Switch to control the export text only + * @since 3.2.0 + */ + protected function getExporttextonly(): int + { + return 0; } } diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power index 7eaac24..adbe70e 100644 --- a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power @@ -259,6 +259,42 @@ return strlen((string) $this->component_code_name); } + /** + * get add namespace prefix + * + * @return bool The add namespace prefix switch + * @since 3.2.0 + */ + protected function getAddnamespaceprefix(): bool + { + // get components override switch + $value = GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'add_namespace_prefix' + ); + + return $value == 1 ? true : false; + } + + /** + * get namespace prefix + * + * @return string The namespace prefix + * @since 3.2.0 + */ + protected function getNamespaceprefix(): string + { + // load based on component settings + $prefix = null; + if ($this->add_namespace_prefix) + { + $prefix = GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'namespace_prefix' + ); + } + + return $prefix ?? $this->params->get('namespace_prefix', 'JCB'); + } + /** * get posted Joomla version * @@ -267,7 +303,7 @@ */ protected function getJoomlaversion(): int { - return 3; // $this->input->post->get('joomla_version', 3, 'INT'); + return $this->input->post->get('joomla_version', 3, 'INT'); } /** @@ -279,8 +315,8 @@ 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 + 3 => ['folder_key' => 3, 'xml_version' => '3.10'], + 4 => ['folder_key' => 4, 'xml_version' => '4.0'] ]; } @@ -490,6 +526,18 @@ return true; } + /** + * get percentage when a language should be added + * + * @return int The percentage value + * @since 3.2.0 + */ + protected function getPercentagelanguageadd(): int + { + // get the global language + return $this->params->get('percentagelanguageadd', 50); + } + /** * get language tag * @@ -552,7 +600,7 @@ // these strings are used to search for language strings in all content return [ 'jjt' => 'Joomla' . '.JText._(', - 'js' => 'JText:' . ':script(', + 'js' => 'Text:' . ':script(', 't' => 'Text:' . ':_(', // namespace and J version will be found 'ts' => 'Text:' . ':sprintf(', // namespace and J version will be found 'jt' => 'JustTEXT:' . ':_(' @@ -625,6 +673,18 @@ return $this->params->get('jcb_powers_path', 'libraries/jcb_powers'); } + /** + * get jcb powers path + * + * @return string The jcb powers path + * @since 3.2.0 + */ + protected function getPowerlibraryfolder(): string + { + // get power library folder path + return trim(str_replace('libraries/', '', $this->jcb_powers_path), '/'); + } + /** * Get local super powers repository path * @@ -971,4 +1031,26 @@ protected function getFootableversion(): int { return 2; // default is version 2 + } + + /** + * The Permission Strict Per Field Switch + * + * @return bool Switch to control the Strict Permission Per/Field + * @since 3.2.0 + */ + protected function getPermissionstrictperfield(): bool + { + return false; + } + + /** + * The Export Text Only Switch + * + * @return int Switch to control the export text only + * @since 3.2.0 + */ + protected function getExporttextonly(): int + { + return 0; } \ No newline at end of file diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php index 00fecb9..1df302c 100644 --- a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php @@ -159,7 +159,7 @@ class Customtabs { // add the tab $tmp = PHP_EOL . $_tab . Indent::_(1) - . ""; @@ -174,7 +174,7 @@ class Customtabs $tmp .= PHP_EOL . $_tab . Indent::_(3) . ''; $tmp .= PHP_EOL . $_tab . Indent::_(2) . ''; $tmp .= PHP_EOL . $_tab . Indent::_(1) - . ""; + . ""; // update html $tab['html'] = $tmp; diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.power b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.power index 55ba7c8..302eefd 100644 --- a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.power +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.power @@ -127,7 +127,7 @@ { // add the tab $tmp = PHP_EOL . $_tab . Indent::_(1) - . ""; @@ -142,7 +142,7 @@ $tmp .= PHP_EOL . $_tab . Indent::_(3) . ''; $tmp .= PHP_EOL . $_tab . Indent::_(2) . ''; $tmp .= PHP_EOL . $_tab . Indent::_(1) - . ""; + . ""; // update html $tab['html'] = $tmp; diff --git a/super-powers.json b/super-powers.json index dd7f034..6f8952f 100644 --- a/super-powers.json +++ b/super-powers.json @@ -120,6 +120,17 @@ "spk": "Super__071c7cff_4c88_4b80_bd99_066c572dcb71__Power", "guid": "071c7cff-4c88-4b80-bd99-066c572dcb71" }, + "0a524af3-f647-4f62-a422-d7d36ebe749b": { + "name": "ConfigFieldsets", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/0a524af3-f647-4f62-a422-d7d36ebe749b\/code.php", + "power": "src\/0a524af3-f647-4f62-a422-d7d36ebe749b\/code.power", + "settings": "src\/0a524af3-f647-4f62-a422-d7d36ebe749b\/settings.json", + "path": "src\/0a524af3-f647-4f62-a422-d7d36ebe749b", + "spk": "Super__0a524af3_f647_4f62_a422_d7d36ebe749b__Power", + "guid": "0a524af3-f647-4f62-a422-d7d36ebe749b" + }, "0b45357f-b077-4337-92f3-65c1e19d36cd": { "name": "HiddenFields", "type": "final class", @@ -197,6 +208,17 @@ "spk": "Super__0f141480_afe6_41fb_996c_2a4e566a2f0d__Power", "guid": "0f141480-afe6-41fb-996c-2a4e566a2f0d" }, + "0fe3133d-1ff3-4444-9229-4218d8fb338e": { + "name": "ConfigFieldsetsGlobal", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/0fe3133d-1ff3-4444-9229-4218d8fb338e\/code.php", + "power": "src\/0fe3133d-1ff3-4444-9229-4218d8fb338e\/code.power", + "settings": "src\/0fe3133d-1ff3-4444-9229-4218d8fb338e\/settings.json", + "path": "src\/0fe3133d-1ff3-4444-9229-4218d8fb338e", + "spk": "Super__0fe3133d_1ff3_4444_9229_4218d8fb338e__Power", + "guid": "0fe3133d-1ff3-4444-9229-4218d8fb338e" + }, "1133c2d7-ba7e-4c95-8cde-01f084d04682": { "name": "PowerInterface", "type": "interface", @@ -230,6 +252,17 @@ "spk": "Super__143ac6ea_b64f_4331_9a97_31e3fce2bb69__Power", "guid": "143ac6ea-b64f-4331-9a97-31e3fce2bb69" }, + "15615db0-02b9-454f-a82e-1ab39ae5e6a9": { + "name": "AccessSections", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/15615db0-02b9-454f-a82e-1ab39ae5e6a9\/code.php", + "power": "src\/15615db0-02b9-454f-a82e-1ab39ae5e6a9\/code.power", + "settings": "src\/15615db0-02b9-454f-a82e-1ab39ae5e6a9\/settings.json", + "path": "src\/15615db0-02b9-454f-a82e-1ab39ae5e6a9", + "spk": "Super__15615db0_02b9_454f_a82e_1ab39ae5e6a9__Power", + "guid": "15615db0-02b9-454f-a82e-1ab39ae5e6a9" + }, "15b4addf-bf6b-4691-9c92-858c7de9c2c1": { "name": "SiteFieldData", "type": "final class", @@ -296,6 +329,17 @@ "spk": "Super__1aefb8f5_486f_4f00_adf9_696340b3254e__Power", "guid": "1aefb8f5-486f-4f00-adf9-696340b3254e" }, + "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe": { + "name": "InputButton", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFour", + "code": "src\/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe\/code.php", + "power": "src\/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe\/code.power", + "settings": "src\/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe\/settings.json", + "path": "src\/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe", + "spk": "Super__1b8a40e9_7847_4341_8a8e_dfdc2d531bbe__Power", + "guid": "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe" + }, "1bd48df2-4f7e-4581-9fe9-4b54e59105e3": { "name": "Gui", "type": "class", @@ -351,6 +395,17 @@ "spk": "Super__1d967151_7c20_4ca7_9400_65233cdcd4db__Power", "guid": "1d967151-7c20-4ca7-9400-65233cdcd4db" }, + "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49": { + "name": "Header", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFour", + "code": "src\/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49\/code.php", + "power": "src\/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49\/code.power", + "settings": "src\/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49\/settings.json", + "path": "src\/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49", + "spk": "Super__1ee227b9_da0f_4e7b_ae66_99a9d53f6f49__Power", + "guid": "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49" + }, "1efdded5-d6c8-452c-8f37-0374483a7b3f": { "name": "Structure", "type": "class", @@ -406,6 +461,39 @@ "spk": "Super__202f748a_516b_4782_962e_ac9725c3cac4__Power", "guid": "202f748a-516b-4782-962e-ac9725c3cac4" }, + "207b5ef3-b3bb-45bf-af14-4572e296d761": { + "name": "FrontendParams", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/207b5ef3-b3bb-45bf-af14-4572e296d761\/code.php", + "power": "src\/207b5ef3-b3bb-45bf-af14-4572e296d761\/code.power", + "settings": "src\/207b5ef3-b3bb-45bf-af14-4572e296d761\/settings.json", + "path": "src\/207b5ef3-b3bb-45bf-af14-4572e296d761", + "spk": "Super__207b5ef3_b3bb_45bf_af14_4572e296d761__Power", + "guid": "207b5ef3-b3bb-45bf-af14-4572e296d761" + }, + "208bc37c-0055-44df-9a34-63d6bfa10765": { + "name": "ConfigFieldsetsCustomfield", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/208bc37c-0055-44df-9a34-63d6bfa10765\/code.php", + "power": "src\/208bc37c-0055-44df-9a34-63d6bfa10765\/code.power", + "settings": "src\/208bc37c-0055-44df-9a34-63d6bfa10765\/settings.json", + "path": "src\/208bc37c-0055-44df-9a34-63d6bfa10765", + "spk": "Super__208bc37c_0055_44df_9a34_63d6bfa10765__Power", + "guid": "208bc37c-0055-44df-9a34-63d6bfa10765" + }, + "20cf1825-29d0-4c6c-8fe9-a1e13a4dac53": { + "name": "ConfigFieldsets", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53\/code.php", + "power": "src\/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53\/code.power", + "settings": "src\/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53\/settings.json", + "path": "src\/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53", + "spk": "Super__20cf1825_29d0_4c6c_8fe9_a1e13a4dac53__Power", + "guid": "20cf1825-29d0-4c6c-8fe9-a1e13a4dac53" + }, "20ed72b0-fcac-4344-aee1-8a65e3bf221d": { "name": "EventInterface", "type": "interface", @@ -417,8 +505,30 @@ "spk": "Super__20ed72b0_fcac_4344_aee1_8a65e3bf221d__Power", "guid": "20ed72b0-fcac-4344-aee1-8a65e3bf221d" }, + "23766738-d0a4-4d0a-8555-7e4c97c0cddd": { + "name": "CanDelete", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaThree\\Model", + "code": "src\/23766738-d0a4-4d0a-8555-7e4c97c0cddd\/code.php", + "power": "src\/23766738-d0a4-4d0a-8555-7e4c97c0cddd\/code.power", + "settings": "src\/23766738-d0a4-4d0a-8555-7e4c97c0cddd\/settings.json", + "path": "src\/23766738-d0a4-4d0a-8555-7e4c97c0cddd", + "spk": "Super__23766738_d0a4_4d0a_8555_7e4c97c0cddd__Power", + "guid": "23766738-d0a4-4d0a-8555-7e4c97c0cddd" + }, + "23f2ca33-440a-4941-8e9a-4bc67522c0cb": { + "name": "FileInjector", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb\/code.php", + "power": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb\/code.power", + "settings": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb\/settings.json", + "path": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb", + "spk": "Super__23f2ca33_440a_4941_8e9a_4bc67522c0cb__Power", + "guid": "23f2ca33-440a-4941-8e9a-4bc67522c0cb" + }, "24da9672-e47f-4bb1-b6c0-0ebfc17f0957": { - "name": "CoreValidation", + "name": "CoreRule", "type": "class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", "code": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957\/code.php", @@ -450,6 +560,17 @@ "spk": "Super__253317c7_3c3b_48a0_aec8_8af5e7a86504__Power", "guid": "253317c7-3c3b-48a0-aec8-8af5e7a86504" }, + "25c7ca86-6088-4f5f-b9fe-13504779c6ba": { + "name": "History", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFour", + "code": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba\/code.php", + "power": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba\/code.power", + "settings": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba\/settings.json", + "path": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba", + "spk": "Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power", + "guid": "25c7ca86-6088-4f5f-b9fe-13504779c6ba" + }, "268b85ef-49f3-4c39-8187-bb12e38d19ee": { "name": "Dynamicpath", "type": "class", @@ -461,6 +582,17 @@ "spk": "Super__268b85ef_49f3_4c39_8187_bb12e38d19ee__Power", "guid": "268b85ef-49f3-4c39-8187-bb12e38d19ee" }, + "274a78d1-24c2-4486-b560-b86e9ae72872": { + "name": "Contributors", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/274a78d1-24c2-4486-b560-b86e9ae72872\/code.php", + "power": "src\/274a78d1-24c2-4486-b560-b86e9ae72872\/code.power", + "settings": "src\/274a78d1-24c2-4486-b560-b86e9ae72872\/settings.json", + "path": "src\/274a78d1-24c2-4486-b560-b86e9ae72872", + "spk": "Super__274a78d1_24c2_4486_b560_b86e9ae72872__Power", + "guid": "274a78d1-24c2-4486-b560-b86e9ae72872" + }, "28cac2bb-df04-454f-b4d6-923b573eb94e": { "name": "ModelWhmcsField", "type": "final class", @@ -494,6 +626,17 @@ "spk": "Super__295186de_5954_4a65_a4c1_2f79ef305743__Power", "guid": "295186de-5954-4a65-a4c1-2f79ef305743" }, + "2a69a8ab-cea0-4c75-92d5-9495cb740e0f": { + "name": "CanDelete", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFour\\Model", + "code": "src\/2a69a8ab-cea0-4c75-92d5-9495cb740e0f\/code.php", + "power": "src\/2a69a8ab-cea0-4c75-92d5-9495cb740e0f\/code.power", + "settings": "src\/2a69a8ab-cea0-4c75-92d5-9495cb740e0f\/settings.json", + "path": "src\/2a69a8ab-cea0-4c75-92d5-9495cb740e0f", + "spk": "Super__2a69a8ab_cea0_4c75_92d5_9495cb740e0f__Power", + "guid": "2a69a8ab-cea0-4c75-92d5-9495cb740e0f" + }, "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9": { "name": "UpdateMysql", "type": "class", @@ -505,6 +648,17 @@ "spk": "Super__2b5c9989_1d4e_4f59_8b95_5cd2f72f82d9__Power", "guid": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9" }, + "2bc33733-e900-4a9c-8cb3-c537aa9db785": { + "name": "InputButton", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", + "code": "src\/2bc33733-e900-4a9c-8cb3-c537aa9db785\/code.php", + "power": "src\/2bc33733-e900-4a9c-8cb3-c537aa9db785\/code.power", + "settings": "src\/2bc33733-e900-4a9c-8cb3-c537aa9db785\/settings.json", + "path": "src\/2bc33733-e900-4a9c-8cb3-c537aa9db785", + "spk": "Super__2bc33733_e900_4a9c_8cb3_c537aa9db785__Power", + "guid": "2bc33733-e900-4a9c-8cb3-c537aa9db785" + }, "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7": { "name": "Builder", "type": "class", @@ -604,6 +758,17 @@ "spk": "Super__313b43c4_98c3_4f62_9177_2d73ec8eba31__Power", "guid": "313b43c4-98c3-4f62-9177-2d73ec8eba31" }, + "31c8127c-0d42-4e09-be81-7cf243c5b30f": { + "name": "ConfigFieldsetsGooglechart", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/31c8127c-0d42-4e09-be81-7cf243c5b30f\/code.php", + "power": "src\/31c8127c-0d42-4e09-be81-7cf243c5b30f\/code.power", + "settings": "src\/31c8127c-0d42-4e09-be81-7cf243c5b30f\/settings.json", + "path": "src\/31c8127c-0d42-4e09-be81-7cf243c5b30f", + "spk": "Super__31c8127c_0d42_4e09_be81_7cf243c5b30f__Power", + "guid": "31c8127c-0d42-4e09-be81-7cf243c5b30f" + }, "3230dd65-6590-4043-9bb8-bebd6d8224b2": { "name": "ComponentFields", "type": "final class", @@ -692,6 +857,17 @@ "spk": "Super__369ae3f5_90db_43b9_aba9_ce5c83311c4e__Power", "guid": "369ae3f5-90db-43b9-aba9-ce5c83311c4e" }, + "36d49d4a-8d0e-435f-ab4c-8f247d96fd4d": { + "name": "Header", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d\/code.php", + "power": "src\/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d\/code.power", + "settings": "src\/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d\/settings.json", + "path": "src\/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d", + "spk": "Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power", + "guid": "36d49d4a-8d0e-435f-ab4c-8f247d96fd4d" + }, "380bb7a3-cdcc-4336-a699-5070cbf521a5": { "name": "Insert", "type": "final class", @@ -703,6 +879,17 @@ "spk": "Super__380bb7a3_cdcc_4336_a699_5070cbf521a5__Power", "guid": "380bb7a3-cdcc-4336-a699-5070cbf521a5" }, + "396f9883-4e50-4b65-a1d5-05bd6c23df30": { + "name": "AccessSectionsJoomlaFields", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/396f9883-4e50-4b65-a1d5-05bd6c23df30\/code.php", + "power": "src\/396f9883-4e50-4b65-a1d5-05bd6c23df30\/code.power", + "settings": "src\/396f9883-4e50-4b65-a1d5-05bd6c23df30\/settings.json", + "path": "src\/396f9883-4e50-4b65-a1d5-05bd6c23df30", + "spk": "Super__396f9883_4e50_4b65_a1d5_05bd6c23df30__Power", + "guid": "396f9883-4e50-4b65-a1d5-05bd6c23df30" + }, "39ea8150-f124-4e47-909d-641bf1c96d5e": { "name": "Data", "type": "class", @@ -714,6 +901,17 @@ "spk": "Super__39ea8150_f124_4e47_909d_641bf1c96d5e__Power", "guid": "39ea8150-f124-4e47-909d-641bf1c96d5e" }, + "3a777d70-52ad-49ec-9016-6f7438608613": { + "name": "HeaderInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/3a777d70-52ad-49ec-9016-6f7438608613\/code.php", + "power": "src\/3a777d70-52ad-49ec-9016-6f7438608613\/code.power", + "settings": "src\/3a777d70-52ad-49ec-9016-6f7438608613\/settings.json", + "path": "src\/3a777d70-52ad-49ec-9016-6f7438608613", + "spk": "Super__3a777d70_52ad_49ec_9016_6f7438608613__Power", + "guid": "3a777d70-52ad-49ec-9016-6f7438608613" + }, "3ab0eba9-f37b-4b37-aec1-2e78067f2aff": { "name": "Super", "type": "final class", @@ -747,6 +945,17 @@ "spk": "Super__3f83fe11_1ef6_4020_bd73_f3bb58cefe3a__Power", "guid": "3f83fe11-1ef6-4020-bd73-f3bb58cefe3a" }, + "425b1107-933d-4436-87ac-63540ec101c5": { + "name": "AllowAdd", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFour\\Controller", + "code": "src\/425b1107-933d-4436-87ac-63540ec101c5\/code.php", + "power": "src\/425b1107-933d-4436-87ac-63540ec101c5\/code.power", + "settings": "src\/425b1107-933d-4436-87ac-63540ec101c5\/settings.json", + "path": "src\/425b1107-933d-4436-87ac-63540ec101c5", + "spk": "Super__425b1107_933d_4436_87ac_63540ec101c5__Power", + "guid": "425b1107-933d-4436-87ac-63540ec101c5" + }, "4325745f-da1f-4d4d-a591-3189fe8c06e5": { "name": "HistoryInterface", "type": "interface", @@ -758,6 +967,17 @@ "spk": "Super__4325745f_da1f_4d4d_a591_3189fe8c06e5__Power", "guid": "4325745f-da1f-4d4d-a591-3189fe8c06e5" }, + "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb": { + "name": "CoreRule", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFour", + "code": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb\/code.php", + "power": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb\/code.power", + "settings": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb\/settings.json", + "path": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb", + "spk": "Super__43f46bb2_ab6d_47c7_9fd9_f1745a3576fb__Power", + "guid": "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb" + }, "44d039b9-d293-481b-b560-23a6e7a63962": { "name": "FieldString", "type": "final class", @@ -769,6 +989,17 @@ "spk": "Super__44d039b9_d293_481b_b560_23a6e7a63962__Power", "guid": "44d039b9-d293-481b-b560-23a6e7a63962" }, + "44efa649-736d-4656-a0ec-e4f1653a6742": { + "name": "LanguageMessages", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/44efa649-736d-4656-a0ec-e4f1653a6742\/code.php", + "power": "src\/44efa649-736d-4656-a0ec-e4f1653a6742\/code.power", + "settings": "src\/44efa649-736d-4656-a0ec-e4f1653a6742\/settings.json", + "path": "src\/44efa649-736d-4656-a0ec-e4f1653a6742", + "spk": "Super__44efa649_736d_4656_a0ec_e4f1653a6742__Power", + "guid": "44efa649-736d-4656-a0ec-e4f1653a6742" + }, "45652787-9085-4c67-914f-0da25ae62646": { "name": "JsonItem", "type": "final class", @@ -791,6 +1022,17 @@ "spk": "Super__46b02edb_427e_4c26_a5cb_279828eb4433__Power", "guid": "46b02edb-427e-4c26-a5cb-279828eb4433" }, + "4729c2b0-f12b-4397-8d77-055d38bca98b": { + "name": "Event", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFour", + "code": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b\/code.php", + "power": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b\/code.power", + "settings": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b\/settings.json", + "path": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b", + "spk": "Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power", + "guid": "4729c2b0-f12b-4397-8d77-055d38bca98b" + }, "4801f8b0-4a4a-4eda-8f0e-cf77f042c35e": { "name": "FieldDynamic", "type": "final class", @@ -934,6 +1176,17 @@ "spk": "Super__510dc0f6_da3f_4a78_b43d_3a03e2cb5fae__Power", "guid": "510dc0f6-da3f-4a78-b43d-3a03e2cb5fae" }, + "5133a033-1351-43ec-9692-2907d7b9aacd": { + "name": "PermissionFields", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/5133a033-1351-43ec-9692-2907d7b9aacd\/code.php", + "power": "src\/5133a033-1351-43ec-9692-2907d7b9aacd\/code.power", + "settings": "src\/5133a033-1351-43ec-9692-2907d7b9aacd\/settings.json", + "path": "src\/5133a033-1351-43ec-9692-2907d7b9aacd", + "spk": "Super__5133a033_1351_43ec_9692_2907d7b9aacd__Power", + "guid": "5133a033-1351-43ec-9692-2907d7b9aacd" + }, "516f93b8-5fff-41c6-aeaf-2d93180a12cc": { "name": "Utilities", "type": "class", @@ -1000,6 +1253,17 @@ "spk": "Super__55e61314_ba10_4e2b_92dd_b44adebabce9__Power", "guid": "55e61314-ba10-4e2b-92dd-b44adebabce9" }, + "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60": { + "name": "ArchitectureController", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60\/code.php", + "power": "src\/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60\/code.power", + "settings": "src\/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60\/settings.json", + "path": "src\/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60", + "spk": "Super__56ba30f5_a5c4_4c4c_be6f_a56f7f9cbc60__Power", + "guid": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60" + }, "58b7f907-4195-4ca3-886c-17877be59887": { "name": "DatabaseUniqueGuid", "type": "final class", @@ -1088,6 +1352,28 @@ "spk": "Super__5e3d856d_8174_4131_b4e9_9328066438e1__Power", "guid": "5e3d856d-8174-4131-b4e9-9328066438e1" }, + "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab": { + "name": "ConfigFieldsetsEncryption", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab\/code.php", + "power": "src\/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab\/code.power", + "settings": "src\/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab\/settings.json", + "path": "src\/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab", + "spk": "Super__5e3fc314_646b_4834_8b1a_1a79f3d4d2ab__Power", + "guid": "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab" + }, + "5f44e66a-31d0-45ff-92b3-b7372dc57ae9": { + "name": "SettingsInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Component", + "code": "src\/5f44e66a-31d0-45ff-92b3-b7372dc57ae9\/code.php", + "power": "src\/5f44e66a-31d0-45ff-92b3-b7372dc57ae9\/code.power", + "settings": "src\/5f44e66a-31d0-45ff-92b3-b7372dc57ae9\/settings.json", + "path": "src\/5f44e66a-31d0-45ff-92b3-b7372dc57ae9", + "spk": "Super__5f44e66a_31d0_45ff_92b3_b7372dc57ae9__Power", + "guid": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9" + }, "5f57ff1a-c196-45b1-a2ac-33766b44fb95": { "name": "ContentMulti", "type": "class", @@ -1110,6 +1396,17 @@ "spk": "Super__5f8e8fa6_3793_44af_882d_9cfb209434e9__Power", "guid": "5f8e8fa6-3793-44af-882d-9cfb209434e9" }, + "600515b1-493f-4448-96fe-018e54e087c8": { + "name": "CanEditStateInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Architecture\\Model", + "code": "src\/600515b1-493f-4448-96fe-018e54e087c8\/code.php", + "power": "src\/600515b1-493f-4448-96fe-018e54e087c8\/code.power", + "settings": "src\/600515b1-493f-4448-96fe-018e54e087c8\/settings.json", + "path": "src\/600515b1-493f-4448-96fe-018e54e087c8", + "spk": "Super__600515b1_493f_4448_96fe_018e54e087c8__Power", + "guid": "600515b1-493f-4448-96fe-018e54e087c8" + }, "63782f74-7b03-4745-aa40-0adf8ed4e704": { "name": "History", "type": "class", @@ -1124,7 +1421,7 @@ "63dabe82-0f4a-4ade-9851-8518ade23de2": { "name": "Settings", "type": "final class", - "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component\\JoomlaThree", "code": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2\/code.php", "power": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2\/code.power", "settings": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2\/settings.json", @@ -1165,6 +1462,17 @@ "spk": "Super__6784dd52_0909_451a_a872_9a942a023c68__Power", "guid": "6784dd52-0909-451a-a872-9a942a023c68" }, + "6992384f-4f29-489f-a52e-286e03f4593b": { + "name": "HasMenuGlobal", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/6992384f-4f29-489f-a52e-286e03f4593b\/code.php", + "power": "src\/6992384f-4f29-489f-a52e-286e03f4593b\/code.power", + "settings": "src\/6992384f-4f29-489f-a52e-286e03f4593b\/settings.json", + "path": "src\/6992384f-4f29-489f-a52e-286e03f4593b", + "spk": "Super__6992384f_4f29_489f_a52e_286e03f4593b__Power", + "guid": "6992384f-4f29-489f-a52e-286e03f4593b" + }, "6a1dddb3-a955-425e-b713-8ef81f256035": { "name": "Title", "type": "final class", @@ -1209,6 +1517,17 @@ "spk": "Super__6c89c663_78f5_4078_9fac_7047f2eaaf96__Power", "guid": "6c89c663-78f5-4078-9fac-7047f2eaaf96" }, + "6d179307-b6e5-4f50-962b-5b6360d0759e": { + "name": "AccessSectionsCategory", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/6d179307-b6e5-4f50-962b-5b6360d0759e\/code.php", + "power": "src\/6d179307-b6e5-4f50-962b-5b6360d0759e\/code.power", + "settings": "src\/6d179307-b6e5-4f50-962b-5b6360d0759e\/settings.json", + "path": "src\/6d179307-b6e5-4f50-962b-5b6360d0759e", + "spk": "Super__6d179307_b6e5_4f50_962b_5b6360d0759e__Power", + "guid": "6d179307-b6e5-4f50-962b-5b6360d0759e" + }, "6da2afa5-6087-46dd-80a0-74c6434bcb18": { "name": "ExtractorInterface", "type": "interface", @@ -1385,6 +1704,17 @@ "spk": "Super__7a5fd3f3_199e_43ba_a8e8_f473d6c030ec__Power", "guid": "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec" }, + "7b56a097-9979-477b-b18a-c9dfc2f1e13b": { + "name": "Header", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaThree", + "code": "src\/7b56a097-9979-477b-b18a-c9dfc2f1e13b\/code.php", + "power": "src\/7b56a097-9979-477b-b18a-c9dfc2f1e13b\/code.power", + "settings": "src\/7b56a097-9979-477b-b18a-c9dfc2f1e13b\/settings.json", + "path": "src\/7b56a097-9979-477b-b18a-c9dfc2f1e13b", + "spk": "Super__7b56a097_9979_477b_b18a_c9dfc2f1e13b__Power", + "guid": "7b56a097-9979-477b-b18a-c9dfc2f1e13b" + }, "7c07c9d6-34cd-4491-934a-ef0a83f414c0": { "name": "LockBase", "type": "class", @@ -1451,6 +1781,17 @@ "spk": "Super__81de8f57_dd9c_4a17_964f_848cd4a0743b__Power", "guid": "81de8f57-dd9c-4a17-964f-848cd4a0743b" }, + "84c11075-570a-4907-9be0-9305e0fabe3c": { + "name": "ConfigFieldsetsUikit", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/84c11075-570a-4907-9be0-9305e0fabe3c\/code.php", + "power": "src\/84c11075-570a-4907-9be0-9305e0fabe3c\/code.power", + "settings": "src\/84c11075-570a-4907-9be0-9305e0fabe3c\/settings.json", + "path": "src\/84c11075-570a-4907-9be0-9305e0fabe3c", + "spk": "Super__84c11075_570a_4907_9be0_9305e0fabe3c__Power", + "guid": "84c11075-570a-4907-9be0-9305e0fabe3c" + }, "8561f1f6-96c7-4e54-8869-0132116d57ce": { "name": "CheckBox", "type": "final class", @@ -1539,6 +1880,17 @@ "spk": "Super__8a63e87b_b39b_4a15_8044_9b2a2f4fb61c__Power", "guid": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c" }, + "8bf026e7-9ae0-423c-b74b-5bc16c54acf7": { + "name": "CustomButtonPermissions", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/8bf026e7-9ae0-423c-b74b-5bc16c54acf7\/code.php", + "power": "src\/8bf026e7-9ae0-423c-b74b-5bc16c54acf7\/code.power", + "settings": "src\/8bf026e7-9ae0-423c-b74b-5bc16c54acf7\/settings.json", + "path": "src\/8bf026e7-9ae0-423c-b74b-5bc16c54acf7", + "spk": "Super__8bf026e7_9ae0_423c_b74b_5bc16c54acf7__Power", + "guid": "8bf026e7-9ae0-423c-b74b-5bc16c54acf7" + }, "8c018533-e967-4bf2-9bd9-9e92966fcb5e": { "name": "UniqueName", "type": "class", @@ -1583,6 +1935,17 @@ "spk": "Super__8f46f85d_7921_44e9_a40e_dc4f01c5d43a__Power", "guid": "8f46f85d-7921-44e9-a40e-dc4f01c5d43a" }, + "8faaed82-522d-4f78-bd43-0ab3f7c72e5f": { + "name": "AllowEdit", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaThree\\Controller", + "code": "src\/8faaed82-522d-4f78-bd43-0ab3f7c72e5f\/code.php", + "power": "src\/8faaed82-522d-4f78-bd43-0ab3f7c72e5f\/code.power", + "settings": "src\/8faaed82-522d-4f78-bd43-0ab3f7c72e5f\/settings.json", + "path": "src\/8faaed82-522d-4f78-bd43-0ab3f7c72e5f", + "spk": "Super__8faaed82_522d_4f78_bd43_0ab3f7c72e5f__Power", + "guid": "8faaed82-522d-4f78-bd43-0ab3f7c72e5f" + }, "8fdd604f-53e7-4a91-9935-afcfd2f6ac1b": { "name": "Creator", "type": "class", @@ -1737,6 +2100,28 @@ "spk": "Super__9769f3b2_17bf_4f20_b54b_3a4ebe572b36__Power", "guid": "9769f3b2-17bf-4f20-b54b-3a4ebe572b36" }, + "98419ff3-6628-4539-8365-37f88378bced": { + "name": "Request", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/98419ff3-6628-4539-8365-37f88378bced\/code.php", + "power": "src\/98419ff3-6628-4539-8365-37f88378bced\/code.power", + "settings": "src\/98419ff3-6628-4539-8365-37f88378bced\/settings.json", + "path": "src\/98419ff3-6628-4539-8365-37f88378bced", + "spk": "Super__98419ff3_6628_4539_8365_37f88378bced__Power", + "guid": "98419ff3-6628-4539-8365-37f88378bced" + }, + "992a842f-1ba9-4a5c-b214-042459ffe038": { + "name": "AllowEditInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Architecture\\Controller", + "code": "src\/992a842f-1ba9-4a5c-b214-042459ffe038\/code.php", + "power": "src\/992a842f-1ba9-4a5c-b214-042459ffe038\/code.power", + "settings": "src\/992a842f-1ba9-4a5c-b214-042459ffe038\/settings.json", + "path": "src\/992a842f-1ba9-4a5c-b214-042459ffe038", + "spk": "Super__992a842f_1ba9_4a5c_b214_042459ffe038__Power", + "guid": "992a842f-1ba9-4a5c-b214-042459ffe038" + }, "99368a6f-2f64-4d4e-ad3a-544d4020ecc6": { "name": "DatabaseName", "type": "class", @@ -1748,6 +2133,17 @@ "spk": "Super__99368a6f_2f64_4d4e_ad3a_544d4020ecc6__Power", "guid": "99368a6f-2f64-4d4e-ad3a-544d4020ecc6" }, + "9b5872d6-c1d8-4602-b443-5844d2c950ee": { + "name": "AssetsRules", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/9b5872d6-c1d8-4602-b443-5844d2c950ee\/code.php", + "power": "src\/9b5872d6-c1d8-4602-b443-5844d2c950ee\/code.power", + "settings": "src\/9b5872d6-c1d8-4602-b443-5844d2c950ee\/settings.json", + "path": "src\/9b5872d6-c1d8-4602-b443-5844d2c950ee", + "spk": "Super__9b5872d6_c1d8_4602_b443_5844d2c950ee__Power", + "guid": "9b5872d6-c1d8-4602-b443-5844d2c950ee" + }, "9c2fdd98-ce4e-4b97-a2f8-ee6990bdcbf7": { "name": "ClassInjectorBuilder", "type": "final class", @@ -1990,6 +2386,17 @@ "spk": "Super__a85451d3_a5c5_446a_90ae_0cf715a16d94__Power", "guid": "a85451d3-a5c5-446a-90ae-0cf715a16d94" }, + "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74": { + "name": "ConfigFieldsetsGroupControl", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74\/code.php", + "power": "src\/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74\/code.power", + "settings": "src\/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74\/settings.json", + "path": "src\/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74", + "spk": "Super__a8d9583a_6ddb_4aac_b0d1_4c2d2d1c8c74__Power", + "guid": "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74" + }, "a8eb2fb1-88ed-4af8-842d-898eb915b588": { "name": "Relations", "type": "class", @@ -2023,6 +2430,17 @@ "spk": "Super__a90a2495_9c26_446c_867e_9ee8f42fb6af__Power", "guid": "a90a2495-9c26-446c-867e-9ee8f42fb6af" }, + "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11": { + "name": "ConfigFieldsetsSiteControl", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11\/code.php", + "power": "src\/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11\/code.power", + "settings": "src\/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11\/settings.json", + "path": "src\/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11", + "spk": "Super__aac8502a_dbdf_42b6_a9ba_2c2e941f8b11__Power", + "guid": "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11" + }, "abdb7d20-a15e-42d8-bd91-7b09514df7f2": { "name": "SiteEditView", "type": "final class", @@ -2200,7 +2618,7 @@ "guid": "b94aaedb-6774-4739-a63f-8f87141a85db" }, "b9f05dc4-d23a-499a-a826-9749b81818ed": { - "name": "CoreValidationInterface", + "name": "CoreRuleInterface", "type": "interface", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Field", "code": "src\/b9f05dc4-d23a-499a-a826-9749b81818ed\/code.php", @@ -2232,6 +2650,39 @@ "spk": "Super__bb29a833_73f7_4283_9327_bc7e41f0723b__Power", "guid": "bb29a833-73f7-4283-9327-bc7e41f0723b" }, + "bbd36fbf-d905-47e8-8e67-9ea6ec734712": { + "name": "ArchitectureModel", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/bbd36fbf-d905-47e8-8e67-9ea6ec734712\/code.php", + "power": "src\/bbd36fbf-d905-47e8-8e67-9ea6ec734712\/code.power", + "settings": "src\/bbd36fbf-d905-47e8-8e67-9ea6ec734712\/settings.json", + "path": "src\/bbd36fbf-d905-47e8-8e67-9ea6ec734712", + "spk": "Super__bbd36fbf_d905_47e8_8e67_9ea6ec734712__Power", + "guid": "bbd36fbf-d905-47e8-8e67-9ea6ec734712" + }, + "bce9ac2b-9f46-413f-b046-9e8af3f7dfbe": { + "name": "CanEditState", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaThree\\Model", + "code": "src\/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe\/code.php", + "power": "src\/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe\/code.power", + "settings": "src\/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe\/settings.json", + "path": "src\/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe", + "spk": "Super__bce9ac2b_9f46_413f_b046_9e8af3f7dfbe__Power", + "guid": "bce9ac2b-9f46-413f-b046-9e8af3f7dfbe" + }, + "bcf1e767-1566-440d-9f67-5c1bada934fa": { + "name": "ExtensionsParams", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/bcf1e767-1566-440d-9f67-5c1bada934fa\/code.php", + "power": "src\/bcf1e767-1566-440d-9f67-5c1bada934fa\/code.power", + "settings": "src\/bcf1e767-1566-440d-9f67-5c1bada934fa\/settings.json", + "path": "src\/bcf1e767-1566-440d-9f67-5c1bada934fa", + "spk": "Super__bcf1e767_1566_440d_9f67_5c1bada934fa__Power", + "guid": "bcf1e767-1566-440d-9f67-5c1bada934fa" + }, "be4ccfae-65a9-401e-bdbe-637d8c226954": { "name": "Config", "type": "class", @@ -2288,9 +2739,9 @@ "guid": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe" }, "c600f58c-3fe2-4d2d-b711-2660eab6effe": { - "name": "InputButton", - "type": "final class", - "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "name": "InputButtonInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Field", "code": "src\/c600f58c-3fe2-4d2d-b711-2660eab6effe\/code.php", "power": "src\/c600f58c-3fe2-4d2d-b711-2660eab6effe\/code.power", "settings": "src\/c600f58c-3fe2-4d2d-b711-2660eab6effe\/settings.json", @@ -2298,6 +2749,17 @@ "spk": "Super__c600f58c_3fe2_4d2d_b711_2660eab6effe__Power", "guid": "c600f58c-3fe2-4d2d-b711-2660eab6effe" }, + "c6818275-cdf7-4fce-a365-90d95a77a71c": { + "name": "CoreField", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFour", + "code": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c\/code.php", + "power": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c\/code.power", + "settings": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c\/settings.json", + "path": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c", + "spk": "Super__c6818275_cdf7_4fce_a365_90d95a77a71c__Power", + "guid": "c6818275-cdf7-4fce-a365-90d95a77a71c" + }, "c6c30d66-3106-44eb-9272-b2cf7ec74613": { "name": "Field", "type": "class", @@ -2343,7 +2805,7 @@ "guid": "c7b6f0d5-ec47-4166-915c-e78d49b4fb63" }, "c871fb4a-4c33-4302-bb79-a9cd7ef4a557": { - "name": "Validation", + "name": "Rule", "type": "class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", "code": "src\/c871fb4a-4c33-4302-bb79-a9cd7ef4a557\/code.php", @@ -2375,6 +2837,17 @@ "spk": "Super__c902743e_8c6e_4a50_a4a3_8c955ef2960f__Power", "guid": "c902743e-8c6e-4a50-a4a3-8c955ef2960f" }, + "c9700450-4f44-4455-bc86-6a7660daadee": { + "name": "AllowAddInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Architecture\\Controller", + "code": "src\/c9700450-4f44-4455-bc86-6a7660daadee\/code.php", + "power": "src\/c9700450-4f44-4455-bc86-6a7660daadee\/code.power", + "settings": "src\/c9700450-4f44-4455-bc86-6a7660daadee\/settings.json", + "path": "src\/c9700450-4f44-4455-bc86-6a7660daadee", + "spk": "Super__c9700450_4f44_4455_bc86_6a7660daadee__Power", + "guid": "c9700450-4f44-4455-bc86-6a7660daadee" + }, "ca111518-e47c-4049-b1b2-cb010f23866f": { "name": "Reverse", "type": "class", @@ -2397,6 +2870,17 @@ "spk": "Super__cb11e8d9_69c2_4095_831c_59908ea402e7__Power", "guid": "cb11e8d9-69c2-4095-831c-59908ea402e7" }, + "cb2a82a5-aa49-4d46-b765-9b3feb118208": { + "name": "CanEditState", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFour\\Model", + "code": "src\/cb2a82a5-aa49-4d46-b765-9b3feb118208\/code.php", + "power": "src\/cb2a82a5-aa49-4d46-b765-9b3feb118208\/code.power", + "settings": "src\/cb2a82a5-aa49-4d46-b765-9b3feb118208\/settings.json", + "path": "src\/cb2a82a5-aa49-4d46-b765-9b3feb118208", + "spk": "Super__cb2a82a5_aa49_4d46_b765_9b3feb118208__Power", + "guid": "cb2a82a5-aa49-4d46-b765-9b3feb118208" + }, "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f": { "name": "Pathfix", "type": "class", @@ -2452,6 +2936,17 @@ "spk": "Super__cef2815b_f72b_402a_b769_f028f676692d__Power", "guid": "cef2815b-f72b-402a-b769-f028f676692d" }, + "cfdf0968-f394-4459-933c-ad1674fb1041": { + "name": "Request", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/cfdf0968-f394-4459-933c-ad1674fb1041\/code.php", + "power": "src\/cfdf0968-f394-4459-933c-ad1674fb1041\/code.power", + "settings": "src\/cfdf0968-f394-4459-933c-ad1674fb1041\/settings.json", + "path": "src\/cfdf0968-f394-4459-933c-ad1674fb1041", + "spk": "Super__cfdf0968_f394_4459_933c_ad1674fb1041__Power", + "guid": "cfdf0968-f394-4459-933c-ad1674fb1041" + }, "cfe62a32-8818-4bfb-8751-2f1e109b5336": { "name": "Dashboard", "type": "final class", @@ -2496,6 +2991,17 @@ "spk": "Super__d3ce5763_4d00_4245_a175_54fc2e80e9b7__Power", "guid": "d3ce5763-4d00-4245-a175-54fc2e80e9b7" }, + "d42e1fac-3c05-4a22-8878-2abd43019811": { + "name": "InstallScript", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Extension\\JoomlaFour", + "code": "src\/d42e1fac-3c05-4a22-8878-2abd43019811\/code.php", + "power": "src\/d42e1fac-3c05-4a22-8878-2abd43019811\/code.power", + "settings": "src\/d42e1fac-3c05-4a22-8878-2abd43019811\/settings.json", + "path": "src\/d42e1fac-3c05-4a22-8878-2abd43019811", + "spk": "Super__d42e1fac_3c05_4a22_8878_2abd43019811__Power", + "guid": "d42e1fac-3c05-4a22-8878-2abd43019811" + }, "d44f3294-6b68-4d85-a617-15fb772b7d14": { "name": "Fieldsetinterface", "type": "interface", @@ -2562,6 +3068,17 @@ "spk": "Super__d7ba2d5d_10b6_470d_978d_9f91ea65ee75__Power", "guid": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75" }, + "d80e58b8-8462-47c4-9dcd-380445f1c64a": { + "name": "ConfigFieldsetsEmailHelper", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/d80e58b8-8462-47c4-9dcd-380445f1c64a\/code.php", + "power": "src\/d80e58b8-8462-47c4-9dcd-380445f1c64a\/code.power", + "settings": "src\/d80e58b8-8462-47c4-9dcd-380445f1c64a\/settings.json", + "path": "src\/d80e58b8-8462-47c4-9dcd-380445f1c64a", + "spk": "Super__d80e58b8_8462_47c4_9dcd_380445f1c64a__Power", + "guid": "d80e58b8-8462-47c4-9dcd-380445f1c64a" + }, "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e": { "name": "SelectionTranslation", "type": "final class", @@ -2595,6 +3112,17 @@ "spk": "Super__dba0776e_e582_4f73_af3e_e7ed17bc34b3__Power", "guid": "dba0776e-e582-4f73-af3e-e7ed17bc34b3" }, + "ddf31f4b-96ba-46e7-8100-f48e1cefe533": { + "name": "AllowEdit", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFour\\Controller", + "code": "src\/ddf31f4b-96ba-46e7-8100-f48e1cefe533\/code.php", + "power": "src\/ddf31f4b-96ba-46e7-8100-f48e1cefe533\/code.power", + "settings": "src\/ddf31f4b-96ba-46e7-8100-f48e1cefe533\/settings.json", + "path": "src\/ddf31f4b-96ba-46e7-8100-f48e1cefe533", + "spk": "Super__ddf31f4b_96ba_46e7_8100_f48e1cefe533__Power", + "guid": "ddf31f4b-96ba-46e7-8100-f48e1cefe533" + }, "de01527a-6586-46ea-92e7-11ea3de1cedb": { "name": "Power", "type": "class", @@ -2628,6 +3156,17 @@ "spk": "Super__e0075978_315d_4807_8507_ce9c6922a885__Power", "guid": "e0075978-315d-4807-8507-ce9c6922a885" }, + "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91": { + "name": "CanDeleteInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Architecture\\Model", + "code": "src\/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91\/code.php", + "power": "src\/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91\/code.power", + "settings": "src\/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91\/settings.json", + "path": "src\/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91", + "spk": "Super__e00a7d1d_6d80_41c5_bf13_32d41bc5bf91__Power", + "guid": "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91" + }, "e046b530-47fe-406f-b45a-b5eec8cbb238": { "name": "PermissionDashboard", "type": "final class", @@ -2672,6 +3211,17 @@ "spk": "Super__e2472b22_a329_44d8_b4a2_ae3ba99e17a0__Power", "guid": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0" }, + "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900": { + "name": "CoreFieldInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Field", + "code": "src\/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900\/code.php", + "power": "src\/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900\/code.power", + "settings": "src\/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900\/settings.json", + "path": "src\/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900", + "spk": "Super__e2f5fddf_cbc8_44ee_836c_7f3fb08d8900__Power", + "guid": "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900" + }, "e38a5276-6664-4bc6-8002-0562fcc248f8": { "name": "AccessSwitch", "type": "final class", @@ -2738,6 +3288,17 @@ "spk": "Super__e5d9804f_0eb0_4ee9_b406_ad4e8cdbc1f6__Power", "guid": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6" }, + "e6683873-b74e-4b54-8466-69f8a9282033": { + "name": "CoreField", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", + "code": "src\/e6683873-b74e-4b54-8466-69f8a9282033\/code.php", + "power": "src\/e6683873-b74e-4b54-8466-69f8a9282033\/code.power", + "settings": "src\/e6683873-b74e-4b54-8466-69f8a9282033\/settings.json", + "path": "src\/e6683873-b74e-4b54-8466-69f8a9282033", + "spk": "Super__e6683873_b74e_4b54_8466_69f8a9282033__Power", + "guid": "e6683873-b74e-4b54-8466-69f8a9282033" + }, "e696927b-e8f4-4cfc-9d25-215db4e3c7a8": { "name": "LibraryManager", "type": "final class", @@ -2782,6 +3343,17 @@ "spk": "Super__e79842d3_51b7_4282_93c7_3487cd8b61ab__Power", "guid": "e79842d3-51b7-4282-93c7-3487cd8b61ab" }, + "e7fff971-b031-42bf-8009-ef554e30854d": { + "name": "Settings", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component\\JoomlaFour", + "code": "src\/e7fff971-b031-42bf-8009-ef554e30854d\/code.php", + "power": "src\/e7fff971-b031-42bf-8009-ef554e30854d\/code.power", + "settings": "src\/e7fff971-b031-42bf-8009-ef554e30854d\/settings.json", + "path": "src\/e7fff971-b031-42bf-8009-ef554e30854d", + "spk": "Super__e7fff971_b031_42bf_8009_ef554e30854d__Power", + "guid": "e7fff971-b031-42bf-8009-ef554e30854d" + }, "e9b6b06b-f600-4f9d-984d-79c70ae7ae92": { "name": "ExtensionCustomFields", "type": "final class", @@ -2837,6 +3409,17 @@ "spk": "Super__ec0682ee_9166_48f8_951b_9b763792c1d1__Power", "guid": "ec0682ee-9166-48f8-951b-9b763792c1d1" }, + "ed314bd8-c995-4282-bcaa-5e0a68ac401b": { + "name": "ConfigFieldsetsCustomfield", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/ed314bd8-c995-4282-bcaa-5e0a68ac401b\/code.php", + "power": "src\/ed314bd8-c995-4282-bcaa-5e0a68ac401b\/code.power", + "settings": "src\/ed314bd8-c995-4282-bcaa-5e0a68ac401b\/settings.json", + "path": "src\/ed314bd8-c995-4282-bcaa-5e0a68ac401b", + "spk": "Super__ed314bd8_c995_4282_bcaa_5e0a68ac401b__Power", + "guid": "ed314bd8-c995-4282-bcaa-5e0a68ac401b" + }, "ed9591cb-0a03-400a-bf47-eaf78ab19b9d": { "name": "Extension", "type": "class", @@ -2947,6 +3530,28 @@ "spk": "Super__f1dc6430_fb54_452e_aa53_ce32ae93db88__Power", "guid": "f1dc6430-fb54-452e-aa53-ce32ae93db88" }, + "f21388dc-5ddc-4970-a3c2-55f075024762": { + "name": "AllowAdd", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaThree\\Controller", + "code": "src\/f21388dc-5ddc-4970-a3c2-55f075024762\/code.php", + "power": "src\/f21388dc-5ddc-4970-a3c2-55f075024762\/code.power", + "settings": "src\/f21388dc-5ddc-4970-a3c2-55f075024762\/settings.json", + "path": "src\/f21388dc-5ddc-4970-a3c2-55f075024762", + "spk": "Super__f21388dc_5ddc_4970_a3c2_55f075024762__Power", + "guid": "f21388dc-5ddc-4970-a3c2-55f075024762" + }, + "f34442df-c84c-44c3-9991-bbf72bffa635": { + "name": "ViewsDefaultOrdering", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/f34442df-c84c-44c3-9991-bbf72bffa635\/code.php", + "power": "src\/f34442df-c84c-44c3-9991-bbf72bffa635\/code.power", + "settings": "src\/f34442df-c84c-44c3-9991-bbf72bffa635\/settings.json", + "path": "src\/f34442df-c84c-44c3-9991-bbf72bffa635", + "spk": "Super__f34442df_c84c_44c3_9991_bbf72bffa635__Power", + "guid": "f34442df-c84c-44c3-9991-bbf72bffa635" + }, "f4578c04-a81e-4218-b80d-b0612196eaf0": { "name": "Filesfolders", "type": "class",