Compare commits

...

16 Commits

Author SHA1 Message Date
339aec221e Moves all major structre function to container. Adds new Server replacment class for legacy calls. Refactored multiple classes. Add more advanced compiler options, with donation notice. 2023-02-12 21:15:41 +02:00
7fa8964b44 Fixed alias builder #973 2023-02-06 13:28:45 +02:00
7edbe20c33 Move the Power, Plugin and Module builders into the container. Many more PHP 8 improvments. 2023-01-29 22:12:42 +02:00
e6c02a29f6 Move the whole compiler GET of the component object to now use the container->component object/class. 2023-01-22 02:38:21 +02:00
f44f385159 Converts compiler to move component get methods to the powers area. 2023-01-15 10:42:19 +02:00
e8abe8e3cf Moved minify to powers. Improved the mapper class. 2023-01-08 12:01:14 +02:00
e771e7d243 Adds some PHP 8 ready changes to compiler classes. Adds Server and Crypt classes. 2023-01-01 04:11:34 +02:00
e614f2ec23 Adds phpseclib version 3. 2022-12-29 08:12:03 +02:00
d28e4c74af Adds power infusion class. 2022-12-18 10:16:43 +02:00
a2ec013566 Moved all placeholder behaviour to class function. Moved dynamic content to the content class. 2022-12-11 17:06:13 +02:00
4217b22f67 Adds new Content class. Adds the intial Package Classes. Removed phpseclib. 2022-12-04 11:23:43 +02:00
6c42b5af61 Rename some database classes, adds the core database classes. 2022-11-27 09:31:56 +02:00
1c7515d0f5 Moved Core Table class to be used all over JCB. 2022-11-20 10:51:56 +02:00
9f5c7deec8 Updates all JCB links. Next stable version 2022-11-13 19:25:52 +02:00
7759738938 Adds form task, token to search form. Adds url updater to search area. 2022-11-12 22:42:08 +02:00
461edf5c3f Adds option to stop and start a search. Adds better user experience to the search area. 2022-11-08 23:55:02 +02:00
692 changed files with 82828 additions and 36210 deletions

View File

@ -1,5 +1,5 @@
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.11) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.17) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end.
+ [Dynamic File and Folder](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=56) Inclusion concept.
+ [Easy Translation](https://www.youtube.com/watch?v=q5NwKGnOHoQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=51) via excel.
+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](http://joomlacomponentbuilder.com)
+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](http://joomlacomponentbuilder.com).
+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](https://www.joomlacomponentbuilder.com)
+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](https://www.joomlacomponentbuilder.com).
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com).
+ Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder!
Get More Demo Content
====================
> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components.
> You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@ -104,11 +104,11 @@ Where can you get support and help?
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
+ [Forum](https://vdm.bz/jcb-forum)
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
+ [Report a Security Issue](https://www.joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint)
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
Since [JCB](https://www.joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
@ -125,14 +125,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER!
====================
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO
======
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com).
- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this)
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
- Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details
@ -140,16 +140,16 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 4th November, 2022
+ *Version*: 3.1.11
+ *Last Build*: 12th February, 2023
+ *Version*: 3.1.17
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **334175**
+ *Field count*: **2004**
+ *File count*: **2183**
+ *Folder count*: **381**
+ *Line count*: **364590**
+ *Field count*: **2009**
+ *File count*: **2325**
+ *Folder count*: **409**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -1,5 +1,5 @@
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.11) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.17) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end.
+ [Dynamic File and Folder](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=56) Inclusion concept.
+ [Easy Translation](https://www.youtube.com/watch?v=q5NwKGnOHoQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=51) via excel.
+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](http://joomlacomponentbuilder.com)
+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](http://joomlacomponentbuilder.com).
+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](https://www.joomlacomponentbuilder.com)
+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](https://www.joomlacomponentbuilder.com).
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com).
+ Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder!
Get More Demo Content
====================
> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components.
> You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@ -104,11 +104,11 @@ Where can you get support and help?
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
+ [Forum](https://vdm.bz/jcb-forum)
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
+ [Report a Security Issue](https://www.joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint)
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
Since [JCB](https://www.joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
@ -125,14 +125,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER!
====================
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO
======
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com).
- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this)
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
- Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details
@ -140,16 +140,16 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 4th November, 2022
+ *Version*: 3.1.11
+ *Last Build*: 12th February, 2023
+ *Version*: 3.1.17
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **334175**
+ *Field count*: **2004**
+ *File count*: **2183**
+ *Folder count*: **381**
+ *Line count*: **364590**
+ *Field count*: **2009**
+ *File count*: **2325**
+ *Folder count*: **409**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -19,7 +19,6 @@
<action name="admin_view.access" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC" />
<action name="admin_view.batch" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE_DESC" />
<action name="admin_view.create" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE_DESC" />
<action name="admin_view.dashboard_add" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD_DESC" />
<action name="admin_view.dashboard_list" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST_DESC" />
<action name="admin_view.delete" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE_DESC" />
<action name="admin_view.edit" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT_DESC" />
@ -235,7 +234,6 @@
<action name="custom_admin_view.get_snippets" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="custom_admin_view.access" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_ACCESS_DESC" />
<action name="custom_admin_view.batch" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE_DESC" />
<action name="custom_admin_view.dashboard_add" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC" />
<action name="custom_admin_view.dashboard_list" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST_DESC" />
<action name="custom_admin_view.version" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EDIT_VERSION" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EDIT_VERSION_DESC" />
<action name="custom_admin_view.export" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT_DESC" />
@ -500,6 +498,7 @@
<action name="power.submenu" title="COM_COMPONENTBUILDER_POWERS_SUBMENU" description="COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC" />
<action name="search.access" title="COM_COMPONENTBUILDER_SEARCH_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC" />
<action name="search.compiler" title="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC" />
<action name="search.dashboard_list" title="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST_DESC" />
<action name="search.submenu" title="COM_COMPONENTBUILDER_SEARCH_SUBMENU" description="COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC" />
<action name="server.access" title="COM_COMPONENTBUILDER_SERVERS_ACCESS" description="COM_COMPONENTBUILDER_SERVERS_ACCESS_DESC" />
<action name="server.batch" title="COM_COMPONENTBUILDER_SERVERS_BATCH_USE" description="COM_COMPONENTBUILDER_SERVERS_BATCH_USE_DESC" />
@ -518,7 +517,6 @@
<action name="site_view.get_snippets" title="COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="site_view.access" title="COM_COMPONENTBUILDER_SITE_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_SITE_VIEWS_ACCESS_DESC" />
<action name="site_view.batch" title="COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE" description="COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE_DESC" />
<action name="site_view.dashboard_add" title="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC" />
<action name="site_view.dashboard_list" title="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST_DESC" />
<action name="site_view.version" title="COM_COMPONENTBUILDER_SITE_VIEWS_EDIT_VERSION" description="COM_COMPONENTBUILDER_SITE_VIEWS_EDIT_VERSION_DESC" />
<action name="site_view.export" title="COM_COMPONENTBUILDER_SITE_VIEWS_EXPORT" description="COM_COMPONENTBUILDER_SITE_VIEWS_EXPORT_DESC" />

View File

@ -11,13 +11,16 @@
/* CSS Document */
.selected {
background-color:#d7d8db !important
background-color:#d7d8db !important
}
tr.selected td {
background-color:#d7d8db !important
background-color:#d7d8db !important
}
#search_settings_block .controls {
margin-left: 1px !important;
}
tr {
cursor:pointer
cursor:pointer
}
.found_code {
color: #46a546;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -26,15 +26,21 @@ const doSearch = async (signal, tables) => {
// set some search values
let searchValue = searchObject.value;
let replaceValue = replaceObject.value;
let matchValue = matchObject.checked ? 1 : 0;
let wholeValue = wholeObject.checked ? 1 : 0;
let regexValue = regexObject.checked ? 1 : 0;
// add the form data
formData.append('table_name', '');
formData.append('type_search', typeSearch);
formData.append('search_value', searchValue);
formData.append('replace_value', replaceValue);
formData.append('match_case', matchObject.checked ? 1 : 0);
formData.append('whole_word', wholeObject.checked ? 1 : 0);
formData.append('regex_search', regexObject.checked ? 1 : 0);
formData.append('match_case', matchValue);
formData.append('whole_word', wholeValue);
formData.append('regex_search', regexValue);
// update the URL
updateUrlQuery(searchValue, replaceValue, matchValue, wholeValue, regexValue, typeSearch);
let abort_this_search_values = false;
@ -45,6 +51,12 @@ const doSearch = async (signal, tables) => {
// show the progress bar
searchProgressObject.style.display = '';
// hidde the search button
startSearchButton.style.display = 'none';
// show the stop search button
stopSearchButton.style.display = '';
// start search timer
startSearchTimer();
@ -99,6 +111,7 @@ const doSearch = async (signal, tables) => {
// calculate the percent
let percent = 100.0 * (total / progress);
// update the progress bar
searchProgressObject.style.display = ''; // always make sure it still shows...
searchProgressBarObject.style.width = percent.toFixed(2) + '%';
searchProgressBarObject.innerHTML = percent.toFixed(2) + '%';
// when complete hide the progress bar
@ -109,6 +122,10 @@ const doSearch = async (signal, tables) => {
} else {
searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + progress + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_TABLES_WITH') + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS');
}
// show the search button
startSearchButton.style.display = '';
// hidde the stop search button
stopSearchButton.style.display = 'none';
setTimeout(function () {
// hide the progress bar again
searchProgressObject.style.display = 'none';
@ -174,14 +191,14 @@ const getSelectedItem = async (table, row, field, line) => {
formData.append('regex_search', regexObject.checked ? 1 : 0);
// get search value
if (mode == 1) {
// calling URL
postURL = UrlAjax + 'getSearchValue';
} else {
if (mode == 2) {
// add the line value
formData.append('line_nr', line);
// calling URL
postURL = UrlAjax + 'getReplaceValue';
} else {
// calling URL
postURL = UrlAjax + 'getSearchValue';
}
let options = {
@ -214,8 +231,13 @@ const getSelectedItem = async (table, row, field, line) => {
* JS Function to check if we should save/update the all current found items
*/
const replaceAllCheck = () => {
// get the current searc and replace values
let searchValue = searchObject.value;
let replaceValue = replaceObject.value;
// load question
let question = Joomla.JText._('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_REPLACE_BALLB_SEARCH_RESULTS') + '<br />' +
let question = Joomla.JText._('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE') + '<br />' +
Joomla.JText._('COM_COMPONENTBUILDER_YOU_WILL_REPLACE') + ': [<span class="found_code">' + htmlentities(searchValue) + '</span>] ' +
Joomla.JText._('COM_COMPONENTBUILDER_WITH') + ': [<span class="found_code">' + htmlentities(replaceValue) + '</span>]<br />' +
Joomla.JText._('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB') + '<br /><br />' +
Joomla.JText._('COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE');
// do check
@ -322,10 +344,10 @@ const replaceAll = async (signal, tables) => {
if (regexValue == 0) {
// set the replace value as the search value
UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH'), function(){
setSearch(replaceValue, searchValue, matchValue, wholeValue, regexValue, 2);
startNewSearch(replaceValue, searchValue, matchValue, wholeValue, regexValue, 2);
}, function () {
UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){
onChange();
startSearch();
}, function () {
clearSearch();
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
@ -333,7 +355,7 @@ const replaceAll = async (signal, tables) => {
} else {
// else we search it again just to prove its changed
UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){
onChange();
startSearch();
}, function () {
clearSearch();
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
@ -468,10 +490,13 @@ const clearSelectedItem = async () => {
*/
const clearTableItems = async () => {
let table = new DataTable('#search_results_table');
// clear search
table.search('').columns().search( '' );
// clear items
table.clear().draw( true );
// hide the update all items
buttonUpdateAllObject.style.display = 'none';
buttonUpdateAllStyleDisplay('none');
};
/**
@ -496,22 +521,45 @@ const clearSearch = async () => {
/**
* JS Function to set the search and replace values
*/
const setSearch = async (search, replace = '', match = 0, whole = 0, regex = 0, mode = 1) => {
const startNewSearch = async (search, replace = '', match = 0, whole = 0, regex = 0, mode = 1) => {
// redirect to a new search
window.location.href = getSearchURL(search, replace, match, whole, regex, mode);
};
/**
* JS Function to update the URL of the browser with the search query
*/
const updateUrlQuery = async (search, replace = '', match = 0, whole = 0, regex = 0, mode = 1) => {
// update the url query
window.history.pushState({}, '', getSearchURL(search, replace, match, whole, regex, mode));
};
/**
* JS Function to get the current search URL
*/
const getSearchURL = (search, replace = '', match = 0, whole = 0, regex = 0, mode = 1) => {
// check if its a single table search
let table = tableObject.value;
let table_name = '';
if (table != -1) {
table_name = '&table_name=' + urlencode(table);
}
// update the type of search
if (mode == 1) {
window.location.href = UrlSearch +
'&search_value=' + search +
return UrlSearch + table_name +
'&search_value=' + urlencode(search) +
'&type_search=1&match_case=' + match +
'&whole_word=' + whole +
'&regex_search=' + regex;
} else if (mode == 2) {
window.location.href = UrlSearch +
'&search_value=' + search +
'&replace_value=' + replace +
return UrlSearch + table_name +
'&search_value=' + urlencode(search) +
'&replace_value=' + urlencode(replace) +
'&type_search=2&match_case=' + match +
'&whole_word=' + whole +
'&regex_search=' + regex;
}
return UrlSearch + table_name;
};
/**
@ -546,16 +594,35 @@ const removeClass = (elementObject, classNaam) => {
const addTableItems = async (table, items, typeSearch) => {
table.rows.add(items).draw( false );
if (typeSearch == 2) {
buttonUpdateAllObject.style.display = ''; // TODO should only show once all items are loaded
buttonUpdateAllStyleDisplay(''); // TODO should only show once all items are loaded
} else {
buttonUpdateAllObject.style.display = 'none'; // TODO should only show once all items are loaded
buttonUpdateAllStyleDisplay('none'); // TODO should only show once all items are loaded
}
};
/**
* JS Function to update the update all button
*/
const buttonUpdateAllStyleDisplay = async (value) => {
buttonUpdateAllObject.forEach((buttonObject) => {
buttonObject.style.display = value;
});
};
/**
* JS Function to execute (A) on search/replace text change , (B) on search options changes
*/
const onChange = () => {
const startSearch = (field, forced = false) => {
// check mode
let mode = modeObject.querySelector('input[type=\'radio\']:checked').value;
if (mode == 0) {
// reset the search area
window.location.href = UrlSearch;
}
// check if we have an Enter click
if (field && typeof field.code !== 'undefined' && field.code === "Enter") {
forced = true;
}
// get replace value if set
const replaceValue = replaceObject.value;
if (replaceValue.length > 0) {
@ -566,7 +633,7 @@ const onChange = () => {
}
// get search value
const searchValue = searchObject.value;
if (searchValue.length > 2) {
if (searchValue.length > 2 || (searchValue.length > 0 && forced)) {
// Cancel any ongoing requests
if (controller) controller.abort();
@ -594,6 +661,23 @@ const onChange = () => {
}
};
/**
* JS Function to stop a search
*/
const stopSearch = () => {
// Cancel any ongoing requests
if (controller) controller.abort();
// show the search button
startSearchButton.style.display = '';
// hidde the stop search button
stopSearchButton.style.display = 'none';
// remove the progress bar at some point
setTimeout(function () {
// hide the progress bar again
searchProgressObject.style.display = 'none';
}, 13000);
}
/**
* JS Function to hide search settings and show table search
*/
@ -831,3 +915,42 @@ function getHtmlTranslationTable(table, quoteStyle) { // eslint-disable-line cam
return hashMap
}
function urlencode (str) {
// discuss at: https://locutus.io/php/urlencode/
// original by: Philip Peterson
// improved by: Kevin van Zonneveld (https://kvz.io)
// improved by: Kevin van Zonneveld (https://kvz.io)
// improved by: Brett Zamir (https://brett-zamir.me)
// improved by: Lars Fischer
// improved by: Waldo Malqui Silva (https://fayr.us/waldo/)
// input by: AJ
// input by: travc
// input by: Brett Zamir (https://brett-zamir.me)
// input by: Ratheous
// bugfixed by: Kevin van Zonneveld (https://kvz.io)
// bugfixed by: Kevin van Zonneveld (https://kvz.io)
// bugfixed by: Joris
// reimplemented by: Brett Zamir (https://brett-zamir.me)
// reimplemented by: Brett Zamir (https://brett-zamir.me)
// note 1: This reflects PHP 5.3/6.0+ behavior
// note 1: Please be aware that this function
// note 1: expects to encode into UTF-8 encoded strings, as found on
// note 1: pages served as UTF-8
// example 1: urlencode('Kevin van Zonneveld!')
// returns 1: 'Kevin+van+Zonneveld%21'
// example 2: urlencode('https://kvz.io/')
// returns 2: 'https%3A%2F%2Fkvz.io%2F'
// example 3: urlencode('https://www.google.nl/search?q=Locutus&ie=utf-8')
// returns 3: 'https%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3DLocutus%26ie%3Dutf-8'
str = (str + '')
return encodeURIComponent(str)
.replace(/!/g, '%21')
.replace(/'/g, '%27')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')
.replace(/\*/g, '%2A')
.replace(/~/g, '%7E')
.replace(/%20/g, '+')
}

View File

@ -171,19 +171,19 @@ class ComponentbuilderControllerCompiler extends AdminController
}
$message[] = '<h2>Total time saved</h2>';
$message[] = '<ul>';
$message[] = '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>';
$message[] = '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>';
$message[] = '<li>Total fields created: <b>'.$model->compiler->fieldCount.'</b></li>';
$message[] = '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>';
$message[] = '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>';
$message[] = '<li>Total folders created: <b>#'.'##FOLDER_COUNT##'.'#</b></li>';
$message[] = '<li>Total files created: <b>#'.'##FILE_COUNT##'.'#</b></li>';
$message[] = '<li>Total fields created: <b>#'.'##FIELD_COUNT##'.'#</b></li>';
$message[] = '<li>Total lines written: <b>#'.'##LINE_COUNT##'.'#</b></li>';
$message[] = '<li>A4 Book of: <b>#'.'##PAGE_COUNT##'.'# pages</b></li>';
$message[] = '</ul>';
$message[] = '<p><b>'.$model->compiler->totalHours.' Hours</b> or <b>'.$model->compiler->totalDays.' Eight Hour Days</b> <em>(actual time you saved)</em><br />';
$message[] = '<p><b>#'.'##totalHours##'.'# Hours</b> or <b>#'.'##totalDays##'.'# Eight Hour Days</b> <em>(actual time you saved)</em><br />';
$message[] = '<small>(if creating a folder and file took <b>5 seconds</b> and writing one line of code took <b>10 seconds</b>, never making one mistake or taking any coffee break.)</small><br />';
$message[] = '<b>'.$model->compiler->actualHoursSpent.' Hours</b> or <b>'.$model->compiler->actualDaysSpent.' Eight Hour Days</b> <em>(the actual time you spent)</em><br />';
$message[] = '<small>(with the following break down: <b>debugging @'.$model->compiler->debuggingHours.'hours</b> = codingtime / 4; <b>planning @'.$model->compiler->planningHours.'hours</b> = codingtime / 7; <b>mapping @'.$model->compiler->mappingHours.'hours</b> = codingtime / 10; <b>office @'.$model->compiler->officeHours.'hours</b> = codingtime / 6;)</small></p>';
$message[] = '<p><b>'.$model->compiler->actualTotalHours.' Hours</b> or <b>'.$model->compiler->actualTotalDays.' Eight Hour Days</b> <em>(a total of the realistic time frame for this project)</em><br />';
$message[] = '<b>#'.'##actualHoursSpent##'.'# Hours</b> or <b>#'.'##actualDaysSpent##'.'# Eight Hour Days</b> <em>(the actual time you spent)</em><br />';
$message[] = '<small>(with the following break down: <b>debugging @#'.'##debuggingHours##'.'#hours</b> = codingtime / 4; <b>planning @#'.'##planningHours##'.'#hours</b> = codingtime / 7; <b>mapping @#'.'##mappingHours##'.'#hours</b> = codingtime / 10; <b>office @#'.'##officeHours##'.'#hours</b> = codingtime / 6;)</small></p>';
$message[] = '<p><b>#'.'##actualTotalHours##'.'# Hours</b> or <b>#'.'##actualTotalDays##'.'# Eight Hour Days</b> <em>(a total of the realistic time frame for this project)</em><br />';
$message[] = '<small>(if creating a folder and file took <b>5 seconds</b> and writing one line of code took <b>10 seconds</b>, with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)</small></p>';
$message[] = '<p>Project duration: <b>'.$model->compiler->projectWeekTime. ' weeks</b> or <b>'.$model->compiler->projectMonthTime.' months</b></p>';
$message[] = '<p>Project duration: <b>'.$model->compiler->projectWeekTime. ' weeks</b> or <b>#'.'##projectMonthTime##'.'# months</b></p>';
// check if we have modules or plugins
if ($add_multi_install)
{
@ -254,9 +254,14 @@ class ComponentbuilderControllerCompiler extends AdminController
$message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download</a></p>';
$message[] = '<p><small><b>Remember!</b> This zip file is in your tmp folder and therefore publicly accessible until you click [Clear tmp]!</small> </p>';
}
$message[] = '<p><small>Compilation took <b>'.$model->compiler->secondsCompiled.'</b> seconds to complete.</small> </p>';
$message[] = '<p><small>Compilation took <b>#'.'##COMPILER_TIMER##'.'#</b> seconds to complete.</small> </p>';
// pass the message via the user state... wow this is painful
$app->setUserState('com_componentbuilder.success_message', implode(PHP_EOL, $message));
$app->setUserState('com_componentbuilder.success_message',
CFactory::_('Placeholder')->update(
implode(PHP_EOL, $message),
CFactory::_('Content')->active
)
);
// set redirect
$this->setRedirect($redirect_url, '<h2>Successful Build!</h2>', 'message');
$app->setUserState('com_componentbuilder.component_folder_name', $model->compiler->filepath['component-folder']);

View File

@ -19,6 +19,7 @@ use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\MathHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
@ -30,11 +31,11 @@ ComponentbuilderHelper::autoLoader();
/**
* Compiler class
* @deprecated 3.3
*/
class Compiler extends Infusion
{
/**
* The Temp path
*
@ -79,7 +80,8 @@ class Compiler extends Infusion
{
// to check the compiler speed
$this->time_start = microtime(true);
// first we run the perent constructors
CFactory::_('Utilities.Counter')->start();
// first we run the parent constructors
if (parent::__construct())
{
// set temp directory
@ -99,33 +101,33 @@ class Compiler extends Infusion
$this->repoPath = $this->params->get('git_folder_path', null);
}
// remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here)
if ($this->removeSiteFolder && $this->removeSiteEditFolder)
if (CFactory::_('Config')->remove_site_folder && CFactory::_('Config')->remove_site_edit_folder)
{
// first remove the files and folders
$this->removeFolder($this->componentPath . '/site');
CFactory::_('Utilities.Folder')->remove(CFactory::_('Utilities.Paths')->component_path . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/'
. $this->fileContentStatic[Placefix::_h('component')] . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents(
$xmlPath
);
$textToSite = ComponentbuilderHelper::getBetween(
$xmlPath = CFactory::_('Utilities.Paths')->component_path . '/'
. CFactory::_('Content')->get('component') . '.xml';
$componentXML = FileHelper::getContent($xmlPath);
$textToSite = GetHelper::between(
$componentXML, '<files folder="site">', '</files>'
);
$textToSiteLang = ComponentbuilderHelper::getBetween(
$textToSiteLang = GetHelper::between(
$componentXML, '<languages folder="site">', '</languages>'
);
$componentXML = str_replace(
array('<files folder="site">' . $textToSite . "</files>",
'<languages folder="site">' . $textToSiteLang
. "</languages>"), array('', ''), $componentXML
. "</languages>"), array('', ''), (string) $componentXML
);
$this->writeFile($xmlPath, $componentXML);
CFactory::_('Utilities.File')->write($xmlPath, $componentXML);
}
// for plugin event TODO change event api signatures
$component_context = CFactory::_('Config')->component_context;
// Trigger Event: jcb_ce_onBeforeUpdateFiles
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeUpdateFiles',
array(&$this->componentContext, &$this)
array(&$component_context, &$this)
);
// now update the files
if (!$this->updateFiles())
@ -135,7 +137,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeGetCustomCode
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeGetCustomCode',
array(&$this->componentContext, &$this)
array(&$component_context, &$this)
);
// now insert into the new files
if (CFactory::_('Customcode')->get())
@ -143,7 +145,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeAddCustomCode
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeAddCustomCode',
array(&$this->componentContext, &$this)
array(&$component_context, &$this)
);
$this->addCustomCode();
@ -151,7 +153,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeSetLangFileData
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeSetLangFileData',
array(&$this->componentContext, &$this)
array(&$component_context, &$this)
);
// set the lang data now
$this->setLangFileData();
@ -218,13 +220,15 @@ class Compiler extends Infusion
$message_fix['sql'] = JText::_(
'The <b>SQL</b> fix updates the #__assets table\'s column size on installation of the component and reverses it back to the Joomla default on uninstall of the component.'
);
// get the asset table fix switch
$add_assets_table_fix = CFactory::_('Config')->get('add_assets_table_fix', 0);
// set assets table rules column notice
if (CFactory::_('Config')->add_assets_table_fix)
if ($add_assets_table_fix)
{
$this->app->enqueueMessage(
JText::_('<hr /><h3>Assets Table Notice</h3>'), 'Notice'
);
$asset_table_fix_type = (CFactory::_('Config')->add_assets_table_fix == 2)
$asset_table_fix_type = ($add_assets_table_fix == 2)
? 'intelligent' : 'sql';
$this->app->enqueueMessage(
JText::sprintf(
@ -243,13 +247,13 @@ class Compiler extends Infusion
$this->app->enqueueMessage(
JText::sprintf(
'The Joomla #__assets table\'s rules column has to be fixed for this component to work coherently. JCB has detected that in worse case the rules column in the #__assets table may require <b>%s</b> characters, and yet the Joomla default is only <b>varchar(5120)</b>. JCB has three option to resolve this issue, first <b>use less permissions</b> in your component, second use the <b>SQL</b> fix, or the <b>intelligent</b> fix. %s %s',
$this->accessWorseCase, $message_fix['intelligent'],
CFactory::_('Config')->access_worse_case, $message_fix['intelligent'],
$message_fix['sql']
), 'Warning'
);
}
// set assets table name column warning if not set
if (!CFactory::_('Config')->add_assets_table_fix && $this->addAssetsTableNameFix)
if (!$add_assets_table_fix && CFactory::_('Config')->add_assets_table_name_fix)
{
// only add if not already added
if ($this->accessSize < 30)
@ -269,8 +273,6 @@ class Compiler extends Infusion
}
// move the update server into place
$this->setUpdateServer();
// set the global counters
$this->setCountingStuff();
// build read me
$this->buildReadMe();
// set local repos
@ -361,6 +363,7 @@ class Compiler extends Infusion
// end the timer here
$this->time_end = microtime(true);
$this->secondsCompiled = $this->time_end - $this->time_start;
CFactory::_('Utilities.Counter')->end();
// completed the compilation
return true;
@ -377,15 +380,13 @@ class Compiler extends Infusion
*/
protected function updateFiles()
{
if (isset($this->newFiles['static'])
&& ArrayHelper::check($this->newFiles['static'])
&& isset($this->newFiles['dynamic'])
&& ArrayHelper::check($this->newFiles['dynamic']))
if (CFactory::_('Utilities.Files')->exists('static')
&& CFactory::_('Utilities.Files')->exists('dynamic'))
{
// get the bom file
$bom = ComponentbuilderHelper::getFileContents($this->bomPath);
$bom = FileHelper::getContent(CFactory::_('Config')->bom_path);
// first we do the static files
foreach ($this->newFiles['static'] as $static)
foreach (CFactory::_('Utilities.Files')->get('static') as $static)
{
if (File::exists($static['path']))
{
@ -395,11 +396,11 @@ class Compiler extends Infusion
}
}
// now we do the dynamic files
foreach ($this->newFiles['dynamic'] as $view => $files)
foreach (CFactory::_('Utilities.Files')->get('dynamic') as $view => $files)
{
if (isset($this->fileContentDynamic[$view])
if (CFactory::_('Content')->exist_($view)
&& ArrayHelper::check(
$this->fileContentDynamic[$view]
CFactory::_('Content')->get_($view)
))
{
foreach ($files as $file)
@ -417,20 +418,17 @@ class Compiler extends Infusion
}
}
// free up some memory
unset($this->fileContentDynamic[$view]);
CFactory::_('Content')->remove_($view);
}
// free up some memory
unset($this->newFiles['dynamic']);
CFactory::_('Utilities.Files')->remove('dynamic');
// do modules if found
if (ArrayHelper::check($this->joomlaModules))
if (CFactory::_('Joomlamodule.Data')->exists())
{
foreach ($this->joomlaModules as $module)
foreach (CFactory::_('Joomlamodule.Data')->get() as $module)
{
if (ObjectHelper::check($module)
&& isset($this->newFiles[$module->key])
&& ArrayHelper::check(
$this->newFiles[$module->key]
))
&& CFactory::_('Utilities.Files')->exists($module->key))
{
// move field or rule if needed
if (isset($module->fields_rules_paths)
@ -486,7 +484,7 @@ class Compiler extends Infusion
}
}
// update the module files
foreach ($this->newFiles[$module->key] as $module_file)
foreach (CFactory::_('Utilities.Files')->get($module->key) as $module_file)
{
if (File::exists($module_file['path']))
{
@ -497,21 +495,18 @@ class Compiler extends Infusion
}
}
// free up some memory
unset($this->newFiles[$module->key]);
unset($this->fileContentDynamic[$module->key]);
CFactory::_('Utilities.Files')->remove($module->key);
CFactory::_('Content')->remove_($module->key);
}
}
}
// do plugins if found
if (ArrayHelper::check($this->joomlaPlugins))
if (CFactory::_('Joomlaplugin.Data')->exists())
{
foreach ($this->joomlaPlugins as $plugin)
foreach (CFactory::_('Joomlaplugin.Data')->get() as $plugin)
{
if (ObjectHelper::check($plugin)
&& isset($this->newFiles[$plugin->key])
&& ArrayHelper::check(
$this->newFiles[$plugin->key]
))
&& CFactory::_('Utilities.Files')->exists($plugin->key))
{
// move field or rule if needed
if (isset($plugin->fields_rules_paths)
@ -567,7 +562,7 @@ class Compiler extends Infusion
}
}
// update the plugin files
foreach ($this->newFiles[$plugin->key] as $plugin_file)
foreach (CFactory::_('Utilities.Files')->get($plugin->key) as $plugin_file)
{
if (File::exists($plugin_file['path']))
{
@ -578,8 +573,8 @@ class Compiler extends Infusion
}
}
// free up some memory
unset($this->newFiles[$plugin->key]);
unset($this->fileContentDynamic[$plugin->key]);
CFactory::_('Utilities.Files')->remove($plugin->key);
CFactory::_('Content')->remove_($plugin->key);
}
}
}
@ -589,13 +584,10 @@ class Compiler extends Infusion
foreach (CFactory::_('Power')->active as $power)
{
if (ObjectHelper::check($power)
&& isset($this->newFiles[$power->key])
&& ArrayHelper::check(
$this->newFiles[$power->key]
))
&& CFactory::_('Utilities.Files')->exists($power->key))
{
// update the power files
foreach ($this->newFiles[$power->key] as $power_file)
foreach (CFactory::_('Utilities.Files')->get($power->key) as $power_file)
{
if (File::exists($power_file['path']))
{
@ -606,8 +598,8 @@ class Compiler extends Infusion
}
}
// free up some memory
unset($this->newFiles[$power->key]);
unset($this->fileContentDynamic[$power->key]);
CFactory::_('Utilities.Files')->remove($power->key);
CFactory::_('Content')->remove_($power->key);
}
}
}
@ -626,59 +618,73 @@ class Compiler extends Infusion
*/
protected function setFileContent(&$name, &$path, &$bom, $view = null)
{
// for plugin event TODO change event api signatures
$component_context = CFactory::_('Config')->component_context;
// Trigger Event: jcb_ce_onBeforeSetFileContent
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeSetFileContent',
array(&$this->componentContext, &$name, &$path, &$bom, &$view)
array(&$component_context, &$name, &$path, &$bom, &$view)
);
// set the file name
$this->fileContentStatic[Placefix::_h('FILENAME')] = $name;
CFactory::_('Content')->set('FILENAME', $name);
// check if the file should get PHP opening
$php = '';
if (ComponentbuilderHelper::checkFileType($name, 'php'))
{
$php = "<?php\n";
}
// get content of the file
$string = ComponentbuilderHelper::getFileContents($path);
$string = FileHelper::getContent($path);
// Trigger Event: jcb_ce_onGetFileContents
CFactory::_('Event')->trigger(
'jcb_ce_onGetFileContents',
array(&$this->componentContext, &$string, &$name, &$path, &$bom,
array(&$component_context, &$string, &$name, &$path, &$bom,
&$view)
);
// see if we should add a BOM
if (strpos($string, Placefix::_h('BOM')) !== false)
if (strpos((string) $string, (string) Placefix::_h('BOM')) !== false)
{
list($wast, $code) = explode(
Placefix::_h('BOM'), $string
Placefix::_h('BOM'), (string) $string
);
$string = $php . $bom . $code;
}
// set the answer
$answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic, 3);
$answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active, 3);
// set the dynamic answer
if ($view)
{
$answer = CFactory::_('Placeholder')->update(
$answer, $this->fileContentDynamic[$view], 3
$answer, CFactory::_('Content')->get_($view), 3
);
}
// check if this file needs extra care :)
if (isset($this->updateFileContent[$path]))
if (CFactory::_('Registry')->exists('update.file.content.' . $path))
{
$answer = CFactory::_('Customcode')->update($answer);
}
// Trigger Event: jcb_ce_onBeforeSetFileContent
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeWriteFileContent',
array(&$this->componentContext, &$answer, &$name, &$path, &$bom,
array(&$component_context, &$answer, &$name, &$path, &$bom,
&$view)
);
// add answer back to file
$this->writeFile($path, $answer);
CFactory::_('Utilities.File')->write($path, $answer);
// count the file lines
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
CFactory::_('Utilities.Counter')->line += substr_count((string) $answer, PHP_EOL);
}
/**
@ -690,32 +696,31 @@ class Compiler extends Infusion
protected function setUpdateServer()
{
// move the component update server to host
if ($this->componentData->add_update_server == 1
&& $this->componentData->update_server_target == 1
if (CFactory::_('Component')->get('add_update_server', 0) == 1
&& isset($this->updateServerFileName)
&& $this->dynamicIntegration)
{
$update_server_xml_path = $this->componentPath . '/'
$update_server_xml_path = CFactory::_('Utilities.Paths')->component_path . '/'
. $this->updateServerFileName . '.xml';
// make sure we have the correct file
if (File::exists($update_server_xml_path)
&& isset($this->componentData->update_server))
&& ($update_server = CFactory::_('Component')->get('update_server')) !== null)
{
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$update_server_xml_path,
$this->updateServerFileName . '.xml',
(int) $this->componentData->update_server,
$this->componentData->update_server_protocol
(int) $update_server,
CFactory::_('Component')->get('update_server_protocol')
);
// remove the local file
File::delete($update_server_xml_path);
}
}
// move the modules update server to host
if (ArrayHelper::check($this->joomlaModules))
if (CFactory::_('Joomlamodule.Data')->exists())
{
foreach ($this->joomlaModules as $module)
foreach (CFactory::_('Joomlamodule.Data')->get() as $module)
{
if (ObjectHelper::check($module)
&& isset($module->add_update_server)
@ -733,7 +738,7 @@ class Compiler extends Infusion
))
{
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$module->update_server_xml_path,
$module->update_server_xml_file_name,
(int) $module->update_server,
@ -746,9 +751,9 @@ class Compiler extends Infusion
}
}
// move the plugins update server to host
if (ArrayHelper::check($this->joomlaPlugins))
if (CFactory::_('Joomlaplugin.Data')->exists())
{
foreach ($this->joomlaPlugins as $plugin)
foreach (CFactory::_('Joomlaplugin.Data')->get() as $plugin)
{
if (ObjectHelper::check($plugin)
&& isset($plugin->add_update_server)
@ -766,7 +771,7 @@ class Compiler extends Infusion
))
{
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$plugin->update_server_xml_path,
$plugin->update_server_xml_file_name,
(int) $plugin->update_server,
@ -787,7 +792,7 @@ class Compiler extends Infusion
&& ArrayHelper::check(
$data['config']
)
&& $this->componentData->mvc_versiondate == 1)
&& CFactory::_('Component')->get('mvc_versiondate', 0) == 1)
{
foreach ($data['config'] as $key => $value)
{
@ -805,68 +810,45 @@ class Compiler extends Infusion
$value = '@update number ' . $value . ' of this MVC';
}
}
$this->fileContentStatic[$key] = $value;
CFactory::_('Content')->set($key, $value);
}
return true;
}
// else insure to reset to global
$this->fileContentStatic[Placefix::_h('CREATIONDATE')]
= $this->fileContentStatic[Placefix::_h('CREATIONDATE')
. 'GLOBAL'];
$this->fileContentStatic[Placefix::_h('BUILDDATE')]
= $this->fileContentStatic[Placefix::_h('BUILDDATE')
. 'GLOBAL'];
$this->fileContentStatic[Placefix::_h('VERSION')]
= $this->fileContentStatic[Placefix::_h('VERSION')
. 'GLOBAL'];
CFactory::_('Content')->set('CREATIONDATE', CFactory::_('Content')->get('GLOBALCREATIONDATE'));
CFactory::_('Content')->set('BUILDDATE', CFactory::_('Content')->get('GLOBALBUILDDATE'));
CFactory::_('Content')->set('VERSION', CFactory::_('Content')->get('GLOBALVERSION'));
}
// set all global numbers
/**
* Set all global numbers
*
* @return void
* @deprecated 3.3
*/
protected function setCountingStuff()
{
// what is the size in terms of an A4 book
$this->pageCount = round($this->lineCount / 56);
// setup the unrealistic numbers
$this->folderSeconds = $this->folderCount * 5;
$this->fileSeconds = $this->fileCount * 5;
$this->lineSeconds = $this->lineCount * 10;
$this->seconds = $this->folderSeconds + $this->fileSeconds
+ $this->lineSeconds;
$this->totalHours = round($this->seconds / 3600);
$this->totalDays = round($this->totalHours / 8);
// setup the more realistic numbers
$this->secondsDebugging = $this->seconds / 4;
$this->secondsPlanning = $this->seconds / 7;
$this->secondsMapping = $this->seconds / 10;
$this->secondsOffice = $this->seconds / 6;
$this->actualSeconds = $this->folderSeconds + $this->fileSeconds
+ $this->lineSeconds + $this->secondsDebugging
+ $this->secondsPlanning + $this->secondsMapping
+ $this->secondsOffice;
$this->actualTotalHours = round($this->actualSeconds / 3600);
$this->actualTotalDays = round($this->actualTotalHours / 8);
$this->debuggingHours = round($this->secondsDebugging / 3600);
$this->planningHours = round($this->secondsPlanning / 3600);
$this->mappingHours = round($this->secondsMapping / 3600);
$this->officeHours = round($this->secondsOffice / 3600);
// the actual time spent
$this->actualHoursSpent = $this->actualTotalHours - $this->totalHours;
$this->actualDaysSpent = $this->actualTotalDays - $this->totalDays;
// calculate the projects actual time frame of completion
$this->projectWeekTime = round($this->actualTotalDays / 5, 1);
$this->projectMonthTime = round($this->actualTotalDays / 24, 1);
// set notice that we could not get a valid string from the target
$this->app->enqueueMessage(
JText::sprintf('<hr /><h3>%s Warning</h3>', __CLASS__), 'Error'
);
$this->app->enqueueMessage(
JText::sprintf(
'Use of a deprecated method (%s)!', __METHOD__
), 'Error'
);
}
private function buildReadMe()
{
// do a final run to update the readme file
$two = 0;
foreach ($this->newFiles['static'] as $static)
foreach (CFactory::_('Utilities.Files')->get('static') as $static)
{
if (('README.md' === $static['name']
|| 'README.txt' === $static['name'])
&& $this->componentData->addreadme
&& CFactory::_('Component')->get('addreadme')
&& File::exists($static['path']))
{
$this->setReadMe($static['path']);
@ -877,97 +859,42 @@ class Compiler extends Infusion
break;
}
}
unset($this->newFiles['static']);
CFactory::_('Utilities.Files')->remove('static');
}
private function setReadMe($path)
{
// set readme data if not set already
if (!isset(
$this->fileContentStatic[Placefix::_h('LINE_COUNT')]
)
|| $this->fileContentStatic[Placefix::_h('LINE_COUNT')]
!= $this->lineCount)
if (!CFactory::_('Content')->exist('LINE_COUNT')
|| CFactory::_('Content')->get('LINE_COUNT') != CFactory::_('Utilities.Counter')->line)
{
$this->buildReadMeData();
CFactory::_('Utilities.Counter')->set();
}
// get the file
$string = ComponentbuilderHelper::getFileContents($path);
$string = FileHelper::getContent($path);
// update the file
$answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic);
$answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active);
// add to zip array
$this->writeFile($path, $answer);
CFactory::_('Utilities.File')->write($path, $answer);
}
/**
* Build README data
*
* @return void
* @deprecated 3.3
*/
private function buildReadMeData()
{
// set some defaults
$this->fileContentStatic[Placefix::_h('LINE_COUNT')]
= $this->lineCount;
$this->fileContentStatic[Placefix::_h('FIELD_COUNT')]
= $this->fieldCount;
$this->fileContentStatic[Placefix::_h('FILE_COUNT')]
= $this->fileCount;
$this->fileContentStatic[Placefix::_h('FOLDER_COUNT')]
= $this->folderCount;
$this->fileContentStatic[Placefix::_h('PAGE_COUNT')]
= $this->pageCount;
$this->fileContentStatic[Placefix::_h('folders')]
= $this->folderSeconds;
$this->fileContentStatic[Placefix::_h('foldersSeconds')]
= $this->folderSeconds;
$this->fileContentStatic[Placefix::_h('files')]
= $this->fileSeconds;
$this->fileContentStatic[Placefix::_h('filesSeconds')]
= $this->fileSeconds;
$this->fileContentStatic[Placefix::_h('lines')]
= $this->lineSeconds;
$this->fileContentStatic[Placefix::_h('linesSeconds')]
= $this->lineSeconds;
$this->fileContentStatic[Placefix::_h('seconds')]
= $this->actualSeconds;
$this->fileContentStatic[Placefix::_h('actualSeconds')]
= $this->actualSeconds;
$this->fileContentStatic[Placefix::_h('totalHours')]
= $this->totalHours;
$this->fileContentStatic[Placefix::_h('totalDays')]
= $this->totalDays;
$this->fileContentStatic[Placefix::_h('debugging')]
= $this->secondsDebugging;
$this->fileContentStatic[Placefix::_h('secondsDebugging')]
= $this->secondsDebugging;
$this->fileContentStatic[Placefix::_h('planning')]
= $this->secondsPlanning;
$this->fileContentStatic[Placefix::_h('secondsPlanning')]
= $this->secondsPlanning;
$this->fileContentStatic[Placefix::_h('mapping')]
= $this->secondsMapping;
$this->fileContentStatic[Placefix::_h('secondsMapping')]
= $this->secondsMapping;
$this->fileContentStatic[Placefix::_h('office')]
= $this->secondsOffice;
$this->fileContentStatic[Placefix::_h('secondsOffice')]
= $this->secondsOffice;
$this->fileContentStatic[Placefix::_h('actualTotalHours')]
= $this->actualTotalHours;
$this->fileContentStatic[Placefix::_h('actualTotalDays')]
= $this->actualTotalDays;
$this->fileContentStatic[Placefix::_h('debuggingHours')]
= $this->debuggingHours;
$this->fileContentStatic[Placefix::_h('planningHours')]
= $this->planningHours;
$this->fileContentStatic[Placefix::_h('mappingHours')]
= $this->mappingHours;
$this->fileContentStatic[Placefix::_h('officeHours')]
= $this->officeHours;
$this->fileContentStatic[Placefix::_h('actualHoursSpent')]
= $this->actualHoursSpent;
$this->fileContentStatic[Placefix::_h('actualDaysSpent')]
= $this->actualDaysSpent;
$this->fileContentStatic[Placefix::_h('projectWeekTime')]
= $this->projectWeekTime;
$this->fileContentStatic[Placefix::_h('projectMonthTime')]
= $this->projectMonthTime;
// set notice that we could not get a valid string from the target
$this->app->enqueueMessage(
JText::sprintf('<hr /><h3>%s Warning</h3>', __CLASS__), 'Error'
);
$this->app->enqueueMessage(
JText::sprintf(
'Use of a deprecated method (%s)!', __METHOD__
), 'Error'
);
}
private function setLocalRepos()
@ -980,29 +907,32 @@ class Compiler extends Infusion
{
// set the repo path
$repoFullPath = $this->repoPath . '/com_'
. $this->componentData->sales_name . '__joomla_'
. CFactory::_('Component')->get('sales_name') . '__joomla_'
. CFactory::_('Config')->get('version', 3);
// for plugin event TODO change event api signatures
$component_context = CFactory::_('Config')->component_context;
$component_path = CFactory::_('Utilities.Paths')->component_path;
// Trigger Event: jcb_ce_onBeforeUpdateRepo
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeUpdateRepo',
array(&$this->componentContext, &$this->componentPath,
array(&$component_context, &$component_path,
&$repoFullPath, &$this->componentData)
);
// remove old data
$this->removeFolder($repoFullPath, $this->componentData->toignore);
CFactory::_('Utilities.Folder')->remove($repoFullPath, CFactory::_('Component')->get('toignore'));
// set the new data
Folder::copy($this->componentPath, $repoFullPath, '', true);
Folder::copy(CFactory::_('Utilities.Paths')->component_path, $repoFullPath, '', true);
// Trigger Event: jcb_ce_onAfterUpdateRepo
CFactory::_('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
array(&$this->componentContext, &$this->componentPath,
array(&$component_context, &$component_path,
&$repoFullPath, &$this->componentData)
);
// move the modules to local folder repos
if (ArrayHelper::check($this->joomlaModules))
if (CFactory::_('Joomlamodule.Data')->exists())
{
foreach ($this->joomlaModules as $module)
foreach (CFactory::_('Joomlamodule.Data')->get() as $module)
{
if (ObjectHelper::check($module)
&& isset($module->file_name))
@ -1020,8 +950,8 @@ class Compiler extends Infusion
&$repoFullPath, &$module)
);
// remove old data
$this->removeFolder(
$repoFullPath, $this->componentData->toignore
CFactory::_('Utilities.Folder')->remove(
$repoFullPath, CFactory::_('Component')->get('toignore')
);
// set the new data
Folder::copy(
@ -1037,9 +967,9 @@ class Compiler extends Infusion
}
}
// move the plugins to local folder repos
if (ArrayHelper::check($this->joomlaPlugins))
if (CFactory::_('Joomlaplugin.Data')->exists())
{
foreach ($this->joomlaPlugins as $plugin)
foreach (CFactory::_('Joomlaplugin.Data')->get() as $plugin)
{
if (ObjectHelper::check($plugin)
&& isset($plugin->file_name))
@ -1057,8 +987,8 @@ class Compiler extends Infusion
&$repoFullPath, &$plugin)
);
// remove old data
$this->removeFolder(
$repoFullPath, $this->componentData->toignore
CFactory::_('Utilities.Folder')->remove(
$repoFullPath, CFactory::_('Component')->get('toignore')
);
// set the new data
Folder::copy(
@ -1079,20 +1009,25 @@ class Compiler extends Infusion
private function zipComponent()
{
// Component Folder Name
$this->filepath['component-folder'] = $this->componentFolderName;
$this->filepath['component-folder'] = CFactory::_('Utilities.Paths')->component_folder_name;
// the name of the zip file to create
$this->filepath['component'] = $this->tempPath . '/'
. $this->filepath['component-folder'] . '.zip';
// for plugin event TODO change event api signatures
$component_context = CFactory::_('Config')->component_context;
$component_path = CFactory::_('Utilities.Paths')->component_path;
$component_sales_name = CFactory::_('Utilities.Paths')->component_sales_name;
$component_folder_name = CFactory::_('Utilities.Paths')->component_folder_name;
// Trigger Event: jcb_ce_onBeforeZipComponent
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeZipComponent',
array(&$this->componentContext, &$this->componentPath,
array(&$component_context, &$component_path,
&$this->filepath['component'], &$this->tempPath,
&$this->componentFolderName, &$this->componentData)
&$component_folder_name, &$this->componentData)
);
//create the zip file
if (FileHelper::zip(
$this->componentPath, $this->filepath['component']
CFactory::_('Utilities.Paths')->component_path, $this->filepath['component']
))
{
// now move to backup if zip was made and backup is required
@ -1100,7 +1035,7 @@ class Compiler extends Infusion
{
// Trigger Event: jcb_ce_onBeforeBackupZip
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeBackupZip', array(&$this->componentContext,
'jcb_ce_onBeforeBackupZip', array(&$component_context,
&$this->filepath['component'],
&$this->tempPath,
&$this->backupPath,
@ -1109,42 +1044,42 @@ class Compiler extends Infusion
// copy the zip to backup path
File::copy(
$this->filepath['component'],
$this->backupPath . '/' . $this->componentBackupName
$this->backupPath . '/' . CFactory::_('Utilities.Paths')->component_backup_name
. '.zip'
);
}
// move to sales server host
if ($this->componentData->add_sales_server == 1
if (CFactory::_('Component')->get('add_sales_server', 0) == 1
&& $this->dynamicIntegration)
{
// make sure we have the correct file
if (isset($this->componentData->sales_server))
if (CFactory::_('Component')->get('sales_server'))
{
// Trigger Event: jcb_ce_onBeforeMoveToServer
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeMoveToServer',
array(&$this->componentContext,
array(&$component_context,
&$this->filepath['component'], &$this->tempPath,
&$this->componentSalesName, &$this->componentData)
&$component_sales_name, &$this->componentData)
);
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$this->filepath['component'],
$this->componentSalesName . '.zip',
(int) $this->componentData->sales_server,
$this->componentData->sales_server_protocol
$component_sales_name . '.zip',
(int) CFactory::_('Component')->get('sales_server'),
CFactory::_('Component')->get('sales_server_protocol')
);
}
}
// Trigger Event: jcb_ce_onAfterZipComponent
CFactory::_('Event')->trigger(
'jcb_ce_onAfterZipComponent',
array(&$this->componentContext, &$this->filepath['component'],
&$this->tempPath, &$this->componentFolderName,
array(&$component_context, &$this->filepath['component'],
&$this->tempPath, &$component_folder_name,
&$this->componentData)
);
// remove the component folder since we are done
if ($this->removeFolder($this->componentPath))
if (CFactory::_('Utilities.Folder')->remove(CFactory::_('Utilities.Paths')->component_path))
{
return true;
}
@ -1155,9 +1090,9 @@ class Compiler extends Infusion
private function zipModules()
{
if (ArrayHelper::check($this->joomlaModules))
if (CFactory::_('Joomlamodule.Data')->exists())
{
foreach ($this->joomlaModules as $module)
foreach (CFactory::_('Joomlamodule.Data')->get() as $module)
{
if (ObjectHelper::check($module)
&& isset($module->zip_name)
@ -1223,7 +1158,7 @@ class Compiler extends Infusion
&$module)
);
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$this->filepath['modules'][$module->id],
$module->zip_name . '.zip',
(int) $module->sales_server,
@ -1240,7 +1175,7 @@ class Compiler extends Infusion
&$module)
);
// remove the module folder since we are done
$this->removeFolder($module->folder_path);
CFactory::_('Utilities.Folder')->remove($module->folder_path);
}
}
}
@ -1249,9 +1184,9 @@ class Compiler extends Infusion
private function zipPlugins()
{
if (ArrayHelper::check($this->joomlaPlugins))
if (CFactory::_('Joomlaplugin.Data')->exists())
{
foreach ($this->joomlaPlugins as $plugin)
foreach (CFactory::_('Joomlaplugin.Data')->get() as $plugin)
{
if (ObjectHelper::check($plugin)
&& isset($plugin->zip_name)
@ -1317,7 +1252,7 @@ class Compiler extends Infusion
&$plugin)
);
// move to server
ComponentbuilderHelper::moveToServer(
CFactory::_('Server')->legacyMove(
$this->filepath['plugins'][$plugin->id],
$plugin->zip_name . '.zip',
(int) $plugin->sales_server,
@ -1334,7 +1269,7 @@ class Compiler extends Infusion
&$plugin)
);
// remove the plugin folder since we are done
$this->removeFolder($plugin->folder_path);
CFactory::_('Utilities.Folder')->remove($plugin->folder_path);
}
}
}
@ -1358,7 +1293,7 @@ class Compiler extends Infusion
$target['hashtarget'][1]
))
{
$file = $this->componentPath . '/' . $target['path'];
$file = CFactory::_('Utilities.Paths')->component_path . '/' . $target['path'];
$size = (int) $target['hashtarget'][0];
$hash = $target['hashtarget'][1];
$cut = $size - 1;
@ -1462,8 +1397,8 @@ class Compiler extends Infusion
$target['id']
);
$data = $placeholder['start'] . PHP_EOL
. CFactory::_('Placeholder')->update(
$target['code'], CFactory::_('Placeholder')->active
. CFactory::_('Placeholder')->update_(
$target['code']
) . $placeholder['end'] . PHP_EOL;
if ($target['type'] == 2)
{
@ -1547,7 +1482,7 @@ class Compiler extends Infusion
$_commentType = " -->";
}
// escape the code
$code = explode(PHP_EOL, $target['code']);
$code = explode(PHP_EOL, (string) $target['code']);
$code = PHP_EOL . $commentType . implode(
$_commentType . PHP_EOL . $commentType, $code
) . $_commentType . PHP_EOL;
@ -1581,10 +1516,10 @@ class Compiler extends Infusion
// move to the position where we should add the data
fseek($fpFile, $position);
// Add the data
fwrite($fpFile, $data);
fwrite($fpFile, (string) $data);
// truncate file at the end of the data that was added
$remove = MathHelper::bc(
'add', $position, mb_strlen($data, '8bit')
'add', $position, mb_strlen((string) $data, '8bit')
);
ftruncate($fpFile, $remove);
// check if this was a replacement of data

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,22 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// add the autoloader for the composer classes
$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php';
if (file_exists($composer_autoloader))
{
require_once $composer_autoloader;
}
// register this component namespace
spl_autoload_register(function ($class) {
// project-specific base directories and namespace prefix
$search = array(
$search = [
'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla',
'libraries/jcb_powers/VDM.Gitea' => 'VDM\\Gitea'
);
'libraries/jcb_powers/VDM.Minify' => 'VDM\\Minify',
'libraries/jcb_powers/VDM.Gitea' => 'VDM\\Gitea',
'libraries/jcb_powers/VDM.Psr' => 'VDM\\Psr'
];
// Start the search and load if found
$found = false;
$found_base_dir = "";
@ -40,7 +49,7 @@ spl_autoload_register(function ($class) {
// check if we found a match
if (!$found)
{
// no, move to the next registered autoloader
// not found so move to the next registered autoloader
return;
}
// get the relative class name
@ -64,10 +73,10 @@ use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use VDM\Joomla\Utilities;
use Joomla\Archive\Archive;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
use VDM\Joomla\Utilities;
/**
* Componentbuilder component helper.
@ -1071,8 +1080,6 @@ abstract class ComponentbuilderHelper
{
// import the Joomla librarys
jimport('joomla.application.component.modellist');
// include class to minify js
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php';
}
// load only if smart
if ('smart' === $type)
@ -3813,31 +3820,31 @@ abstract class ComponentbuilderHelper
switch ($mode)
{
case 'CTR':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CTR);
self::$CRYPT[$key] = new $CLASS('ctr');
break;
case 'ECB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_ECB);
self::$CRYPT[$key] = new $CLASS('ecb');
break;
case 'CBC':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC);
self::$CRYPT[$key] = new $CLASS('cbc');
break;
case 'CBC3':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC3);
self::$CRYPT[$key] = new $CLASS('cbc3');
break;
case 'CFB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB);
self::$CRYPT[$key] = new $CLASS('cfb');
break;
case 'CFB8':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB8);
self::$CRYPT[$key] = new $CLASS('cfb8');
break;
case 'OFB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_OFB);
self::$CRYPT[$key] = new $CLASS('ofb');
break;
case 'GCM':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_GCM);
self::$CRYPT[$key] = new $CLASS('gcm');
break;
case 'STREAM':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_STREAM);
self::$CRYPT[$key] = new $CLASS('stream');
break;
default:
// No valid mode has been specified
@ -3848,7 +3855,7 @@ abstract class ComponentbuilderHelper
}
else
{
// set the
// set the default
self::$CRYPT[$key] = new $CLASS();
}
// return the object
@ -6321,11 +6328,6 @@ abstract class ComponentbuilderHelper
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler');
}
// Access control (search.submenu).
if ($user->authorise('search.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search');
}
if ($user->authorise('joomla_component.access', 'com_componentbuilder') && $user->authorise('joomla_component.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components');
@ -6342,6 +6344,11 @@ abstract class ComponentbuilderHelper
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_POWERS'), 'index.php?option=com_componentbuilder&view=powers', $submenu === 'powers');
}
// Access control (search.access && search.submenu).
if ($user->authorise('search.access', 'com_componentbuilder') && $user->authorise('search.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search');
}
if ($user->authorise('admin_view.access', 'com_componentbuilder') && $user->authorise('admin_view.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=admin_views', $submenu === 'admin_views');

View File

@ -26,6 +26,11 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Mapping class
*/
@ -102,7 +107,7 @@ class Mapping
// set the app to insure messages can be set
$this->app = JFactory::getApplication();
// check that we have data
if (ComponentbuilderHelper::checkArray($data))
if (ArrayHelper::check($data))
{
// make sure we have an id
if (isset($data['id']) && $data['id'] > 0)
@ -117,15 +122,15 @@ class Mapping
{
case 'base64':
// set needed value
$this->$key = base64_decode($value);
$this->$key = base64_decode((string) $value);
break;
case 'json':
// set needed value
$this->$key = json_decode($value, true);
$this->$key = json_decode((string) $value, true);
break;
case 'safeString':
// set needed value
$this->$key = ComponentbuilderHelper::safeString($value);
$this->$key = StringHelper::check($value);
break;
default :
$this->$key = $value;
@ -134,10 +139,10 @@ class Mapping
}
}
// get linked admin views
$addadmin_views = ComponentbuilderHelper::getVar('component_admin_views', $data['id'], 'joomla_component', 'addadmin_views');
if (ComponentbuilderHelper::checkJson($addadmin_views))
$addadmin_views = GetHelper::var('component_admin_views', $data['id'], 'joomla_component', 'addadmin_views');
if (JsonHelper::check($addadmin_views))
{
$this->addadmin_views = json_decode($addadmin_views, true);
$this->addadmin_views = json_decode((string)$addadmin_views, true);
}
// set the map of the views needed
if ($this->setMap())
@ -173,7 +178,7 @@ class Mapping
{
// start parsing the sql dump data
$queries = JDatabaseDriver::splitSql($this->buildcompsql);
if (ComponentbuilderHelper::checkArray($queries))
if (ArrayHelper::check($queries))
{
foreach ($queries as $query)
{
@ -208,7 +213,7 @@ class Mapping
}
}
// check if the mapping was done
if (ComponentbuilderHelper::checkArray($this->map))
if (ArrayHelper::check($this->map))
{
return true;
}
@ -224,12 +229,12 @@ class Mapping
if (strpos($query, '`#__') !== false)
{
// get table name
$tableName = ComponentbuilderHelper::getBetween($query, '`#__', "`");
$tableName = GetHelper::between($query, '`#__', "`");
}
elseif (strpos($query, "'#__") !== false)
{
// get table name
$tableName = ComponentbuilderHelper::getBetween($query, "'#__", "'");
$tableName = GetHelper::between($query, "'#__", "'");
}
// if it still was not found
if (!isset($tableName) || !ComponentbuilderHelper::checkString($tableName))
@ -267,12 +272,12 @@ class Mapping
if (0 === strpos($row, '`'))
{
// get field name
$name = ComponentbuilderHelper::getBetween($row, '`', '`');
$name = GetHelper::between($row, '`', '`');
}
if (0 === strpos($row, "'"))
{
// get field name
$name = ComponentbuilderHelper::getBetween($row, "'", "'");
$name = GetHelper::between($row, "'", "'");
}
// check if the name was found
if (ComponentbuilderHelper::checkString($name))
@ -289,7 +294,7 @@ class Mapping
{
$field['row'] = $row;
$field['name'] = $name;
$field['label'] = ComponentbuilderHelper::safeString($name, 'W');
$field['label'] = StringHelper::check($name, 'W');
$field['fieldType'] = $fieldType;
$field['size'] = $this->getSize($row, $field);
$field['sizeOther'] = '';
@ -319,7 +324,7 @@ class Mapping
}
}
}
if (ComponentbuilderHelper::checkArray($fields))
if (ArrayHelper::check($fields))
{
return $fields;
}
@ -352,7 +357,7 @@ class Mapping
{
if (in_array($field['dataType'], $this->dataSize))
{
return ComponentbuilderHelper::getBetween($row, $field['dataType'].'(', ')');
return GetHelper::between($row, $field['dataType'].'(', ')');
}
return '';
}
@ -365,12 +370,12 @@ class Mapping
// get default value
if (strpos($row, 'DEFAULT "') !== false) // to sure it this is correct...
{
return ComponentbuilderHelper::getBetween($row, 'DEFAULT "', '"');
return GetHelper::between($row, 'DEFAULT "', '"');
}
// get default value
if (strpos($row, "DEFAULT '") !== false)
{
return ComponentbuilderHelper::getBetween($row, "DEFAULT '", "'");
return GetHelper::between($row, "DEFAULT '", "'");
}
return '';
}

View File

@ -26,6 +26,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Builder class
*/
@ -102,7 +106,7 @@ class Builder extends Mapping
{
// set the view object
$object = new stdClass();
$object->system_name = ComponentbuilderHelper::safeString($name, 'W') . ' (dynamic build)';
$object->system_name = StringHelper::check($name, 'W') . ' (dynamic build)';
$object->name_single = $name;
$object->name_list = $name. 's';
$object->short_description = $name. ' view (dynamic build)';
@ -257,14 +261,14 @@ class Builder extends Mapping
}
return false;
}
/**
* get the field type id from system
*/
protected function getFieldType($fieldName)
{
// load the field settings
return ComponentbuilderHelper::getVar('fieldtype', $fieldName, 'name', 'id');
return GetHelper::var('fieldtype', $fieldName, 'name', 'id');
}
/**

View File

@ -26,6 +26,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Extrusion class
*/
@ -58,10 +61,10 @@ class Extrusion extends Builder
protected function setAdminViews(&$component_id)
{
// check if views were set
if (ComponentbuilderHelper::checkArray($this->views))
if (ArrayHelper::check($this->views))
{
$count = 0;
if (ComponentbuilderHelper::checkArray($this->addadmin_views))
if (ArrayHelper::check($this->addadmin_views))
{
$count = (int) count((array)$this->addadmin_views) + 3;
}
@ -84,7 +87,7 @@ class Extrusion extends Builder
$this->addadmin_views['addadmin_views'.$pointer]['order'] = $pointer + 1;
}
}
if (isset($this->addadmin_views) && ComponentbuilderHelper::checkArray($this->addadmin_views))
if (isset($this->addadmin_views) && ArrayHelper::check($this->addadmin_views))
{
// set the field object
$object = new stdClass();
@ -94,7 +97,7 @@ class Extrusion extends Builder
$object->created_by = $this->user->id;
$object->published = 1;
// check if it is already set
if ($item_id = ComponentbuilderHelper::getVar('component_admin_views', $component_id, 'joomla_component', 'id'))
if ($item_id = GetHelper::var('component_admin_views', $component_id, 'joomla_component', 'id'))
{
// set ID
$object->id = (int) $item_id;

View File

@ -1,7 +0,0 @@
in
public
extends
private
protected
implements
instanceof

View File

@ -1,28 +0,0 @@
do
in
let
new
var
case
else
enum
void
with
class
const
yield
delete
export
import
public
return
static
typeof
extends
package
private
continue
function
protected
implements
instanceof

View File

@ -1,47 +0,0 @@
do
if
in
for
let
new
try
var
case
else
enum
eval
null
this
true
void
with
break
catch
class
const
false
super
throw
while
yield
delete
export
import
public
return
static
switch
typeof
default
extends
finally
package
private
continue
debugger
function
arguments
interface
protected
implements
instanceof

View File

@ -1,381 +0,0 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage minify.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Abstract minifier class.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @author Matthias Mullie <minify@mullie.eu>
*
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved.
* @license MIT License
*/
abstract class Minify
{
/**
* The data to be minified
*
* @var string[]
*/
protected $data = array();
/**
* Array of patterns to match.
*
* @var string[]
*/
protected $patterns = array();
/**
* This array will hold content of strings and regular expressions that have
* been extracted from the JS source code, so we can reliably match "code",
* without having to worry about potential "code-like" characters inside.
*
* @var string[]
*/
public $extracted = array();
/**
* Init the minify class - optionally, code may be passed along already.
*/
public function __construct(/* $data = null, ... */)
{
// it's possible to add the source through the constructor as well ;)
if (func_num_args()) {
call_user_func_array(array($this, 'add'), func_get_args());
}
}
/**
* Add a file or straight-up code to be minified.
*
* @param string $data
*/
public function add($data /* $data = null, ... */)
{
// bogus "usage" of parameter $data: scrutinizer warns this variable is
// not used (we're using func_get_args instead to support overloading),
// but it still needs to be defined because it makes no sense to have
// this function without argument :)
$args = array($data) + func_get_args();
// this method can be overloaded
foreach ($args as $data) {
// redefine var
$data = (string) $data;
// load data
$value = $this->load($data);
$key = ($data != $value) ? $data : count($this->data);
// store data
$this->data[$key] = $value;
}
}
/**
* Load data.
*
* @param string $data Either a path to a file or the content itself.
* @return string
*/
protected function load($data)
{
// check if the data is a file
if (@file_exists($data) && is_file($data)) {
$data = @file_get_contents($data);
// strip BOM, if any
if (substr($data, 0, 3) == "\xef\xbb\xbf") {
$data = substr($data, 3);
}
}
return $data;
}
/**
* Save to file
*
* @param string $content The minified data.
* @param string $path The path to save the minified data to.
* @throws Exception
*/
protected function save($content, $path)
{
// create file & open for writing
if (($handler = @fopen($path, 'w')) === false) {
throw new Exception('The file "'.$path.'" could not be opened. Check if PHP has enough permissions.');
}
// write to file
if (@fwrite($handler, $content) === false) {
throw new Exception('The file "'.$path.'" could not be written to. Check if PHP has enough permissions.');
}
// close the file
@fclose($handler);
}
/**
* Minify the data & (optionally) saves it to a file.
*
* @param string[optional] $path Path to write the data to.
* @return string The minified data.
*/
public function minify($path = null)
{
$content = $this->execute($path);
// save to path
if ($path !== null) {
$this->save($content, $path);
}
return $content;
}
/**
* Minify & gzip the data & (optionally) saves it to a file.
*
* @param string[optional] $path Path to write the data to.
* @param int[optional] $level Compression level, from 0 to 9.
* @return string The minified & gzipped data.
*/
public function gzip($path = null, $level = 9)
{
$content = $this->execute($path);
$content = gzencode($content, $level, FORCE_GZIP);
// save to path
if ($path !== null) {
$this->save($content, $path);
}
return $content;
}
/**
* Minify the data.
*
* @param string[optional] $path Path to write the data to.
* @return string The minified data.
*/
abstract protected function execute($path = null);
/**
* Register a pattern to execute against the source content.
*
* @param string $pattern PCRE pattern.
* @param string|callable $replacement Replacement value for matched pattern.
* @throws Exception
*/
protected function registerPattern($pattern, $replacement = '')
{
// study the pattern, we'll execute it more than once
$pattern .= 'S';
$this->patterns[] = array($pattern, $replacement);
}
/**
* We can't "just" run some regular expressions against JavaScript: it's a
* complex language. E.g. having an occurrence of // xyz would be a comment,
* unless it's used within a string. Of you could have something that looks
* like a 'string', but inside a comment.
* The only way to accurately replace these pieces is to traverse the JS one
* character at a time and try to find whatever starts first.
*
* @param string $content The content to replace patterns in.
* @return string The (manipulated) content.
*/
protected function replace($content)
{
$processed = '';
$positions = array_fill(0, count($this->patterns), -1);
$matches = array();
while ($content) {
// find first match for all patterns
foreach ($this->patterns as $i => $pattern) {
list($pattern, $replacement) = $pattern;
// no need to re-run matches that are still in the part of the
// content that hasn't been processed
if ($positions[$i] >= 0) {
continue;
}
$match = null;
if (preg_match($pattern, $content, $match)) {
$matches[$i] = $match;
// we'll store the match position as well; that way, we
// don't have to redo all preg_matches after changing only
// the first (we'll still know where those others are)
$positions[$i] = strpos($content, $match[0]);
} else {
// if the pattern couldn't be matched, there's no point in
// executing it again in later runs on this same content;
// ignore this one until we reach end of content
unset($matches[$i]);
$positions[$i] = strlen($content);
}
}
// no more matches to find: everything's been processed, break out
if (!$matches) {
$processed .= $content;
break;
}
// see which of the patterns actually found the first thing (we'll
// only want to execute that one, since we're unsure if what the
// other found was not inside what the first found)
$discardLength = min($positions);
$firstPattern = array_search($discardLength, $positions);
$match = $matches[$firstPattern][0];
// execute the pattern that matches earliest in the content string
list($pattern, $replacement) = $this->patterns[$firstPattern];
$replacement = $this->replacePattern($pattern, $replacement, $content);
// figure out which part of the string was unmatched; that's the
// part we'll execute the patterns on again next
$content = substr($content, $discardLength);
$unmatched = (string) substr($content, strpos($content, $match) + strlen($match));
// move the replaced part to $processed and prepare $content to
// again match batch of patterns against
$processed .= substr($replacement, 0, strlen($replacement) - strlen($unmatched));
$content = $unmatched;
// first match has been replaced & that content is to be left alone,
// the next matches will start after this replacement, so we should
// fix their offsets
foreach ($positions as $i => $position) {
$positions[$i] -= $discardLength + strlen($match);
}
}
return $processed;
}
/**
* This is where a pattern is matched against $content and the matches
* are replaced by their respective value.
* This function will be called plenty of times, where $content will always
* move up 1 character.
*
* @param string $pattern Pattern to match.
* @param string|callable $replacement Replacement value.
* @param string $content Content to match pattern against.
* @return string
*/
protected function replacePattern($pattern, $replacement, $content)
{
if (is_callable($replacement)) {
return preg_replace_callback($pattern, $replacement, $content, 1, $count);
} else {
return preg_replace($pattern, $replacement, $content, 1, $count);
}
}
/**
* Strings are a pattern we need to match, in order to ignore potential
* code-like content inside them, but we just want all of the string
* content to remain untouched.
*
* This method will replace all string content with simple STRING#
* placeholder text, so we've rid all strings from characters that may be
* misinterpreted. Original string content will be saved in $this->extracted
* and after doing all other minifying, we can restore the original content
* via restoreStrings()
*
* @param string[optional] $chars
*/
protected function extractStrings($chars = '\'"')
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier) {
if (!$match[1]) {
/*
* Empty strings need no placeholder; they can't be confused for
* anything else anyway.
* But we still needed to match them, for the extraction routine
* to skip over this particular string.
*/
return $match[0];
}
$count = count($minifier->extracted);
$placeholder = $match[1].$count.$match[1];
$minifier->extracted[$placeholder] = $match[1].$match[2].$match[1];
return $placeholder;
};
/*
* The \\ messiness explained:
* * Don't count ' or " as end-of-string if it's escaped (has backslash
* in front of it)
* * Unless... that backslash itself is escaped (another leading slash),
* in which case it's no longer escaping the ' or "
* * So there can be either no backslash, or an even number
* * multiply all of that times 4, to account for the escaping that has
* to be done to pass the backslash into the PHP string without it being
* considered as escape-char (times 2) and to get it in the regex,
* escaped (times 2)
*/
$this->registerPattern('/(['.$chars.'])(.*?((?<!\\\\)|\\\\\\\\+))\\1/s', $callback);
}
/**
* This method will restore all extracted data (strings, regexes) that were
* replaced with placeholder text in extract*(). The original content was
* saved in $this->extracted.
*
* @param string $content
* @return string
*/
protected function restoreExtractedData($content)
{
if (!$this->extracted) {
// nothing was extracted, nothing to restore
return $content;
}
$content = strtr($content, $this->extracted);
$this->extracted = array();
return $content;
}
}

View File

@ -1,45 +0,0 @@
+
-
*
/
%
=
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&
|
^
~
<<
>>
>>>
==
===
!=
!==
>
<
>=
<=
&&
||
.
[
]
?
:
,
;
(
)
{
}

View File

@ -1,43 +0,0 @@
+
-
*
/
%
=
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&
|
^
~
<<
>>
>>>
==
===
!=
!==
>
<
>=
<=
&&
||
!
.
[
?
:
,
;
(
{

View File

@ -416,8 +416,6 @@ COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use"
COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE="Admin Views Create"
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD="Admin Views Dashboard Add"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST="Admin Views Dashboard List"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE="Admin Views Delete"
@ -1286,12 +1284,14 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_YES="Yes"
COM_COMPONENTBUILDER_ADMIN_VIEW_YOUTUBE="Youtube"
COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_IN="Zoom In"
COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_OUT="Zoom Out"
COM_COMPONENTBUILDER_ADVANCED_OPTIONS="Advanced Options"
COM_COMPONENTBUILDER_AHEAD="Ahead"
COM_COMPONENTBUILDER_AHEAD_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BNEWER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Ahead means your <b>local snippet</b> (with the same name, library and type) has a <b>newer modified date</b> then the community snippet (with the same name, library and type)."
COM_COMPONENTBUILDER_AJAX="Ajax"
COM_COMPONENTBUILDER_ALIAS="Alias"
COM_COMPONENTBUILDER_ALIGNMENT="Alignment"
COM_COMPONENTBUILDER_ALL="All"
COM_COMPONENTBUILDER_ALLOWS_YOU_TO_OVERRIDE_THE_BUILD_DATE_BY_SELECTING_A_DATE_MANUALLY_FROM_THE_CALENDER="Allows you to override the build date by selecting a date manually from the calender."
COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED="All found instances in %s where replaced"
COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter."
COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time."
@ -1320,6 +1320,7 @@ COM_COMPONENTBUILDER_AUTHOR_NAME="Author Name"
COM_COMPONENTBUILDER_AUTHOR_WEBSITE="Author Website"
COM_COMPONENTBUILDER_AUTO_CHECKIN="Auto Check-in"
COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES="Available Libraries"
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="A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder(s) are copied into the correct place when this component is installed!"
COM_COMPONENTBUILDER_A_S_SPAN_CLASSICONFLAG_SPANREPORT_BROKEN_PACKAGEA="<a %s ><span class="icon-flag"> </span>Report Broken Package</a>"
COM_COMPONENTBUILDER_BACK="Back"
COM_COMPONENTBUILDER_BACKUP="Backup"
@ -1333,10 +1334,12 @@ COM_COMPONENTBUILDER_BASIC_TUTORIAL_ON_GIT_BSB="Basic Tutorial on git: <b>%s</b>
COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_WE_COULD_NOT_LOAD_THE_CHECKSUM_FOR_THIS_PACKAGE_AND_SO_NO_VALIDATION_WAS_POSSIBLE_THIS_MAY_BE_DUE_TO_YOUR_NETWORK_OR_A_CHANGE_TO_THAT_PACKAGE_NAME="<b>Best to not continue!</b><br />We could not load the checksum for this package, and so no validation was possible. This may be due to your network, or a change to that package name."
COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_YOU_CAN_REFRESH_AND_TRY_AGAINBR_BUT_NOTE_THAT_THIS_PACKAGE_BFAILEDB_CHECKSUM_VALIDATION_THIS_COULD_BE_A_SERIOUS_SECURITY_BREACH_DO_NOT_CONTINUE="<b>Best to not continue!</b><br />You can Refresh and try again.<br />But note that this package <b>FAILED</b> checksum validation, this could be a serious security breach! DO NOT CONTINUE!!!"
COM_COMPONENTBUILDER_BCUSTOM_FILESB_NOT_MOVED_TO_CORRECT_LOCATION="<b>Custom files</b> not moved to correct location!"
COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR="Become a Contributor"
COM_COMPONENTBUILDER_BEHAVIOUR="Behaviour"
COM_COMPONENTBUILDER_BEHIND="Behind"
COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your <b>local snippet</b> (with the same name, library and type) has a <b>older modified date</b> then the community snippet (with the same name, library and type)."
COM_COMPONENTBUILDER_BETA_RELEASE="Beta Release"
COM_COMPONENTBUILDER_BE_A_PART_OF_JCB="Be a Part of JCB"
COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!"
COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="<b>Field type</b> id:%s mismatch in <b>%s</b>."
COM_COMPONENTBUILDER_BFIELD_TYPEB_NOT_SET_FOR_BSB="<b>Field type</b> not set for <b>%s</b>."
@ -1354,6 +1357,7 @@ COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CH
COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB="<b>The tmp folder has been clear successfully!</b>"
COM_COMPONENTBUILDER_BUILD="Build"
COM_COMPONENTBUILDER_BUILDIN="Build-in"
COM_COMPONENTBUILDER_BUILD_DATE="Build Date"
COM_COMPONENTBUILDER_BULK="Bulk"
COM_COMPONENTBUILDER_BULK_GET_ALL_NEW_SNIPPETS="Bulk Get All New Snippets"
COM_COMPONENTBUILDER_BULK_TOOLS="Bulk Tools"
@ -1653,6 +1657,7 @@ COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_DESC="A count of the number of times
COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_LABEL="Version"
COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private. You also have the option to make function/method or property static."
COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL="Visibility"
COM_COMPONENTBUILDER_CLEAR="Clear"
COM_COMPONENTBUILDER_CLEAR_TMP="Clear tmp"
COM_COMPONENTBUILDER_CLONE="Clone"
COM_COMPONENTBUILDER_CLONE_FAILED="Clone failed!"
@ -3667,6 +3672,7 @@ COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL="View & Field"
COM_COMPONENTBUILDER_CONFIG_YES="Yes"
COM_COMPONENTBUILDER_CONFIRMATION_STEP_BEFORE_IMPORTING="Confirmation Step Before Importing!"
COM_COMPONENTBUILDER_CONTEXT="Context"
COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB="Contribute to JCB"
COM_COMPONENTBUILDER_CONTRIBUTOR="Contributor"
COM_COMPONENTBUILDER_CONTRIBUTORS="Contributors"
COM_COMPONENTBUILDER_COPYRIGHT="Copyright"
@ -3690,8 +3696,6 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE="Custom Admin Views Batch Use"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE="Custom Admin Views Create"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD="Custom Admin Views Dashboard Add"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST="Custom Admin Views Dashboard List"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DELETE="Custom Admin Views Delete"
@ -4356,10 +4360,8 @@ COM_COMPONENTBUILDER_DASH="Dashboard"
COM_COMPONENTBUILDER_DASHBOARD="Component Builder Dashboard"
COM_COMPONENTBUILDER_DASHBOARD_ADD_RECORD="Dashboard (add record)"
COM_COMPONENTBUILDER_DASHBOARD_ADMIN_VIEWS="Admin Views<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_ADMIN_VIEW_ADD="Add&nbsp;Admin View<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_COMPILER="Compiler<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_CUSTOM_ADMIN_VIEWS="Custom Admin Views<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_CUSTOM_ADMIN_VIEW_ADD="Add&nbsp;Custom Admin View<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_CUSTOM_CODES="Custom Codes<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GETS="Dynamic Gets<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GET_ADD="Add&nbsp;Dynamic Get<br /><br />"
@ -4380,9 +4382,9 @@ COM_COMPONENTBUILDER_DASHBOARD_LIBRARIES="Libraries<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_LIST_OF_RECORDS="Dashboard (list of records)"
COM_COMPONENTBUILDER_DASHBOARD_PLACEHOLDERS="Placeholders<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_POWERS="Powers<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_SEARCH="Search<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_SERVERS="Servers<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_SITE_VIEWS="Site Views<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_SITE_VIEW_ADD="Add&nbsp;Site View<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_SNIPPETS="Snippets<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_TEMPLATES="Templates<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_TEMPLATE_ADD="Add&nbsp;Template<br /><br />"
@ -4398,6 +4400,8 @@ COM_COMPONENTBUILDER_DISPLAY_SWITCH_FOR_DYNAMIC_PLACEMENT_IN_RELATION_TO_THE_USE
COM_COMPONENTBUILDER_DIVERGED="Diverged"
COM_COMPONENTBUILDER_DIVERGED_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BDIVERGEDB_FROM_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_IN_THAT_IT_DOES_NOT_HAVE_THE_SAME_BCREATIONB_OR_BMODIFIED_DATEB="Diverged means your <b>local snippet</b> (with the same name, library and type) has a <b>diverged</b> from the community snippet (with the same name, library and type) in that it does not have the same <b>creation</b> or <b>modified date</b>."
COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL="Does this package require a key to install."
COM_COMPONENTBUILDER_DONATE_TO_JCB="Donate to JCB"
COM_COMPONENTBUILDER_DONATIONS="Donations!"
COM_COMPONENTBUILDER_DOWNLOAD_UPDATE="Download Update"
COM_COMPONENTBUILDER_DO_NOT_ADD="Do not add"
COM_COMPONENTBUILDER_DTCOMPANYDTDDSDD="<dt>Company</dt><dd>%s</dd>"
@ -4712,6 +4716,7 @@ COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY="Edit %s (%s) directly"
COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version"
COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
COM_COMPONENTBUILDER_EDIT_VIEW="Edit View"
COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY="Elevate JCB Today"
COM_COMPONENTBUILDER_EMAIL="Email"
COM_COMPONENTBUILDER_EMAIL_S="Email %s"
COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT="Email with the new key was sent"
@ -4720,6 +4725,8 @@ COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB="<em>Copyright:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMEMAILEM_BSB="<em>Email:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMLICENSEEM_BSB="<em>License:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMOWNEREM_BSB="<em>Owner:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMPOWER_JCB="Empower JCB"
COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB="Empower the Future with JCB"
COM_COMPONENTBUILDER_EMPTY_TRASH="Empty trash"
COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="<em>Website:</em> <b>%s</b>"
COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT="Enter your replace text"
@ -5455,6 +5462,7 @@ COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update"
COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE="Force that this JCB package import (search for local items) to be done with GUID value only, if <b>Merge</b> is set to yes above."
COM_COMPONENTBUILDER_FOUND="Found"
COM_COMPONENTBUILDER_FOUND_TEXT="Found Text"
COM_COMPONENTBUILDER_FOUR_SPACES="4 Spaces"
COM_COMPONENTBUILDER_FREEOPEN="Free/Open"
COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab"
COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again."
@ -5491,6 +5499,7 @@ COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY="Get the
COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION="Get the snippet from gitHub and update the local version"
COM_COMPONENTBUILDER_GET_TOKEN="Get Token"
COM_COMPONENTBUILDER_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS="Get token from VDM to get update notice, and add it to your global options."
COM_COMPONENTBUILDER_GIVE_TO_JCB="Give to JCB"
COM_COMPONENTBUILDER_GLOBAL="Global"
COM_COMPONENTBUILDER_GLUECODE="Glue/Code"
COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!"
@ -5598,6 +5607,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_LABEL="URL"
COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_MESSAGE="Error! Please add url here."
COM_COMPONENTBUILDER_HELP_DOCUMENT_VERSION_DESC="A count of the number of times this Help Document has been revised."
COM_COMPONENTBUILDER_HELP_DOCUMENT_VERSION_LABEL="Version"
COM_COMPONENTBUILDER_HELP_JCB_GROW="Help JCB Grow"
COM_COMPONENTBUILDER_HELP_MANAGER="Help"
COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_THE_REPLACE_TEXT_THAT_YOU_WOULD_LIKE_TO_USE_AS_REPLACEMENT_FOR_THE_SEARCH_TEXT_FOUND="Here you can enter the replace text that you would like to use as replacement for the search text found."
COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_YOUR_SEARCH_TEXT="Here you can enter your search text."
@ -5608,9 +5618,15 @@ COM_COMPONENTBUILDER_HIDE_ONLY="Hide Only"
COM_COMPONENTBUILDER_HIDE_TOGGLE="Hide Toggle"
COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get <a %s >free keys</a> from VDM."
COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="<hr /><h3>Custom Codes Warning</h3>"
COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="<hr /><h3>c0mp0n3nt issue found</h3><p>The path (%s) could not be used.</p>"
COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="<hr /><h3>Dashboard Error</h3>"
COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="<hr /><h3>Dynamic folder(s) were detected.</h3>"
COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="<hr /><h3>External Code Error</h3>"
COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="<hr /><h3>External Code Notice</h3>"
COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="<hr /><h3>External Code Warning</h3>"
COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE="<hr /><h3>Field Notice</h3>"
COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE="<hr /><h3>File Path Error</h3>"
COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE="<hr /><h3>Folder Path Error</h3>"
COM_COMPONENTBUILDER_HTHREEPLACEHOLDER_REMOVEDHTHREEPBTHISB_CUSTOM_CODE_CAN_ONLY_BE_USED_IN_BOTHERB_CUSTOM_CODE_NOT_IN_IT_SELF_SINCE_THAT_WILL_CAUSE_A_INFINITE_LOOP_IN_THE_COMPILERP="<h3>Placeholder Removed!</h3><p><b>This</b> custom code can only be used in <b>other</b> custom code, not in it self! Since that will cause a infinite loop in the compiler.</p>"
COM_COMPONENTBUILDER_HTHREESHTHREEPCUSTOM_CODE_CAN_ONLY_BE_USED_IN_OTHER_CUSTOM_CODE_IF_SET_AS_BJCB_MANUALB_YOU_CAN_NOT_ADD_THEM_TO_EMHASH_AUTOMATIONEM_CODE_AT_THIS_POINTP="<h3>%s</h3><p>Custom code can only be used in other custom code if set as <b>JCB (manual)</b>, you can not add them to <em>Hash (Automation)</em> code at this point.</p>"
COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="<h3>%s namespace error (%s)</h3><p>You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see <a href=%s >psr-4</a> for more info.</p><p>This %s was therefore removed, <a href=%s>click here</a> to fix this issue.</p>"
@ -5685,6 +5701,10 @@ COM_COMPONENTBUILDER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE="Package to import not
COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA="Import Data"
COM_COMPONENTBUILDER_IMPORT_UPLOAD_BOTTON="Upload File"
COM_COMPONENTBUILDER_INACTIVE="Inactive"
COM_COMPONENTBUILDER_INDENTATION_OPTIONS="Indentation Options"
COM_COMPONENTBUILDER_INVEST_IN_JCB="Invest in JCB"
COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS="Invest in the future of Joomla Component Builder (JCB) by making a <b>financial contribution</b>, no matter how small. The continual support of all those using the tool will be more than enough to ensure its continued growth and relevance. By investing in this open-source project, you are securing its future as a vital tool for PHP programmers."
COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS="Invest in the future of Joomla Component Builder (JCB) by making a <b>financial donation</b>. Support the necessary development and maintenance of this open-source project, ensuring its continued growth and relevance for the community. Your contribution will help secure the future of this vital tool for PHP programmers."
COM_COMPONENTBUILDER_IN_SYNC="In Sync"
COM_COMPONENTBUILDER_ISOLATE="Isolate"
COM_COMPONENTBUILDER_IS_BEING_COMPILED="is being compiled"
@ -5692,14 +5712,66 @@ COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/r
COM_COMPONENTBUILDER_IS_ONLY_FOUR_LISTRADIOCHECKBOXES="Is (only 4 list/radio/checkboxes)"
COM_COMPONENTBUILDER_ITEM_CODE="Item Code"
COM_COMPONENTBUILDER_IWEBSITEI_BSB="<i>Website:</i> <b>%s</b>"
COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE="JCB: Be the Change"
COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE="JCB Builds a Better Future"
COM_COMPONENTBUILDER_JCB_COMMUNITY="JCB Community"
COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS="JCB Community Snippets"
COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE="JCB Contributes to Open-Source"
COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS="JCB Empowers PHP Developers"
COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT="JCB Enables PHP Development"
COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY="JCB Enhances Productivity"
COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY="JCB Fosters a Strong Community"
COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES="JCB Helps Grow Businesses"
COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE="JCB Helps PHP Thrive"
COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION="JCB Improves PHP's Reputation"
COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT="JCB Improves PHP Development"
COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE="JCB Improves User Experience"
COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW="JCB Improves Workflow"
COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED="JCB Increases Development Speed"
COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE="JCB Increases Revenue"
COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION="JCB Increases User Satisfaction"
COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS="JCB Invests in PHP's Success"
COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE="JCB: Invest in Change"
COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT="JCB: Invest in Impact"
COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS="JCB: Invest in Progress"
COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY="JCB: Invest in Progress Today"
COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS="JCB: Invest in Success"
COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY="JCB: Invest in the Community"
COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE="JCB: Invest in the Future"
COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE="JCB: Invest in Your Future"
COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB="JCB is not yet fully ready for Joomla 4, but with your help, we can make the transition faster. Show your support by making a donation today and help us bring JCB to the next level.<br /><br /><b>Your component will still only be compiled for Joomla 3</b>"
COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS="JCB Lowers Development Stress"
COM_COMPONENTBUILDER_JCB_NEEDS_YOU="JCB Needs You"
COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION="JCB Offers a Stronger Solution"
COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES="JCB Offers More Features"
COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT="JCB Package Import"
COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE="JCB Package info path does not work, we advice you <b>not to continue</b> with the import of the selected package!"
COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY="JCB Promotes Efficiency"
COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL="JCB Promotes Goodwill"
COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE="JCB Provides a Better Experience"
COM_COMPONENTBUILDER_JCB_PRO_BOARD="JCB Pro board"
COM_COMPONENTBUILDER_JCB_PRO_NOTICE_BOARD="JCB Pro Notice Board"
COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS="JCB Reduces Development Costs"
COM_COMPONENTBUILDER_JCB_SAVES_TIME="JCB Saves Time"
COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT="JCB Streamlines Development"
COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM="JCB Supports a Thriving Ecosystem"
COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE="JCB Supports a Worthy Cause"
COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE="JCB Supports Open-Source"
COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION="JCB Supports PHP Innovation"
COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY="JCB Supports the PHP Community"
COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS="JCB: Your Contribution Matters"
COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS="JCB: Your Donation Matters"
COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS="JCB: Your Support Counts"
COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY="JCB: Your Support is Key"
COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS="JCB: Your Support Matters"
COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST="JCB: Your Support Matters Most"
COM_COMPONENTBUILDER_JOIN_FIELDS="Join Fields"
COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY="Join JCB's Community"
COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY="Join JCB's Journey"
COM_COMPONENTBUILDER_JOIN_JCBS_MISSION="Join JCB's Mission"
COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS="Join JCB's Success"
COM_COMPONENTBUILDER_JOIN_JCBS_VISION="Join JCB's Vision"
COM_COMPONENTBUILDER_JOIN_TYPE="Join Type"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT="Joomla Component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS="Joomla Components"
@ -5810,6 +5882,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL="MySQL"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMP_DESCRIPTION="To build the component fields and back-end views dynamically using a mySQL table file."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMP_LABEL="Build Backend-views Dynamically"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY="Joomla Component Builder - Backup Key"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY="Joomla Component Builder (JCB) is a crucial tool for PHP programmers who use Joomla to earn a living. By making a <b>financial donation</b>, you can support the growth and continuity of this vital resource and ensure its relevance for years to come. Your contribution, no matter how big or small, will be deeply appreciated by the project's team and the wider community."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLEAR_TMP_BUTTON_ACCESS="Joomla Component Clear tmp Button Access"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLEAR_TMP_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear tmp button."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLONE_BUTTON_ACCESS="Joomla Component Clone Button Access"
@ -6003,7 +6076,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION="<div style='margi
## Build Time<br />
<br />
**###totalHours### Hours** or **###totalDays### Eight Hour Days** (actual time the author saved - <br />
due to [Automated Component Builder](http://joomlacomponentbuilder.com))<br />
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))<br />
<br />
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,<br />
> never making one mistake or taking any coffee break.)<br />
@ -6028,7 +6101,7 @@ due to [Automated Component Builder](http://joomlacomponentbuilder.com))<br />
<br />
Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### months**<br />
<br />
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).<br />
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).<br />
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)<br />
<br />
## Donations<br />
@ -6155,6 +6228,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP"
COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields"
COM_COMPONENTBUILDER_JOOMLA_FOUR="Joomla 4"
COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module"
COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules"
COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access"
@ -7096,6 +7170,8 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_DESC="A count of the number of times
COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_LABEL="Version"
COM_COMPONENTBUILDER_JOOMLA_PLUGIN_YES="Yes"
COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ZIP="ZIP"
COM_COMPONENTBUILDER_JOOMLA_THREE="Joomla 3"
COM_COMPONENTBUILDER_JOOMLA_VERSION="Joomla Version"
COM_COMPONENTBUILDER_JUST_GET_ALL_SNIPPETS="Just Get All Snippets"
COM_COMPONENTBUILDER_KEEP_HISTORY="Keep History"
COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -"
@ -7766,6 +7842,8 @@ COM_COMPONENTBUILDER_LOCAL="Local"
COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"
COM_COMPONENTBUILDER_LOCAL_SNIPPET="Local snippet"
COM_COMPONENTBUILDER_MAIN_MENU="Main Menu"
COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB="Make a Difference with JCB"
COM_COMPONENTBUILDER_MANUAL="Manual"
COM_COMPONENTBUILDER_MATCH_BEHAVIOUR="Match Behaviour"
COM_COMPONENTBUILDER_MATCH_CASE="Match Case"
COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
@ -8017,13 +8095,29 @@ COM_COMPONENTBUILDER_POWERS_N_ITEMS_UNPUBLISHED_1="%s Power unpublished."
COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu"
COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power"
COM_COMPONENTBUILDER_POWER_ABSTRACT_CLASS="abstract class"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION="Library path to the autoload.php file"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT="custom_folder/vendor/autoload.php (must be in the .../public_html/library/ folder of Joomla)"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL="Access Point"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE="Error! Please add autoload full path here."
COM_COMPONENTBUILDER_POWER_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work."
COM_COMPONENTBUILDER_POWER_ADD_HEAD_LABEL="Add Custom Class Header"
COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION="The option to override the licensing template."
COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL="Add Licensing Template"
COM_COMPONENTBUILDER_POWER_AS_LABEL="as"
COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION="<p>Once you have manually pulled composer classes into your own custom folder in libraries area (via composer), you can link it here.</p>
<p>So this feature gives you the ability to add your own custom <b>composer</b> set of classes to your project. Yes, you will still have to manually pull them into your own custom and unique folder into the libraries area of Joomla (on this JCB development system). But you can link it here and JCB will take care of adding it to your component.</p>
<p>First and most importantly (due to obvious risk of collusion), avoid pulling classes into your custom set of composer classes that are already included in the Joomla vendor folder. Those classes that Joomla loads are already available to you. To use them, just add the <b>use Namespace;</b> of that class to the header of this power, and the PHP auto linker will take care of the rest.</p>
<p>So all composer projects =>(vendor folders) has an <code>autoload.php</code> file that is located in the root of the vendor folder. We call this the <b>access point</b> to that cluster of classes. This means you will have <b>one access point</b> for multiple namespaces.</p>
<p>Due the continued risk of collusion <b>we allow only one access point per/power</b>. But for even more peace of mind, it is best to have only one access point per/project. Which means you should try to consolidate your custom composer additional classes (outside of the Joomla vendor folder) into one vendor folder. This will result in <b>one access point</b>, that you will use multiple times for various powers.</p>"
COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL="When to use Autoloader Composer Powers?"
COM_COMPONENTBUILDER_POWER_CLASS="class"
COM_COMPONENTBUILDER_POWER_CODE="Code"
COM_COMPONENTBUILDER_POWER_COMPOSER="Composer"
COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL="Autoloader Composer Powers"
COM_COMPONENTBUILDER_POWER_CREATED_BY_DESC="The user that created this Power."
COM_COMPONENTBUILDER_POWER_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_POWER_CREATED_DATE_DESC="The date this Power was created."
@ -8055,7 +8149,7 @@ COM_COMPONENTBUILDER_POWER_LICENSING="Licensing"
COM_COMPONENTBUILDER_POWER_LICENSING_TEMPLATE_HINT="/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2015
* @created 4th September, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -8141,7 +8235,9 @@ COM_COMPONENTBUILDER_POWER_TYPE_DESCRIPTION="The type of power being build"
COM_COMPONENTBUILDER_POWER_TYPE_LABEL="Type of Power"
COM_COMPONENTBUILDER_POWER_USE="Use"
COM_COMPONENTBUILDER_POWER_USE_GLOBAL="Use Global"
COM_COMPONENTBUILDER_POWER_USE_LABEL="use"
COM_COMPONENTBUILDER_POWER_USE_HINT="Name\Project\ClassName"
COM_COMPONENTBUILDER_POWER_USE_LABEL="Use"
COM_COMPONENTBUILDER_POWER_USE_MESSAGE="Error! Please add namespace here."
COM_COMPONENTBUILDER_POWER_USE_SELECTION_DESCRIPTION="Select namespace you want to use in your power."
COM_COMPONENTBUILDER_POWER_USE_SELECTION_LABEL="Use Selection"
COM_COMPONENTBUILDER_POWER_VERSION_DESC="A count of the number of times this Power has been revised."
@ -8189,6 +8285,8 @@ COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access"
COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search."
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access"
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler button."
COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST="Search Dashboard List"
COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Search"
COM_COMPONENTBUILDER_SEARCH_DATABASE_AGAIN="Search Database Again"
COM_COMPONENTBUILDER_SEARCH_DESC="JCB Search"
COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE="Search, or Search and Replace"
@ -8203,6 +8301,7 @@ COM_COMPONENTBUILDER_SELECT_AN_OPTION="Select an option"
COM_COMPONENTBUILDER_SELECT_A_PROPERTY="Select a property"
COM_COMPONENTBUILDER_SELECT_A_SITE_VIEW="Select a site view"
COM_COMPONENTBUILDER_SELECT_A_SNIPPET="select a snippet"
COM_COMPONENTBUILDER_SELECT_BUILD_DATE="Select Build Date"
COM_COMPONENTBUILDER_SELECT_COMPONENT="Select Component"
COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension"
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile"
@ -8361,6 +8460,7 @@ COM_COMPONENTBUILDER_SHOULD_THIS_FIELD_BE_ESCAPED_IN_THE_LIST_VIEW="Should this
COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT="Should we be showing more elaborate information during import."
COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED="Should we force the update of all local data, even if it is newer then the data being imported."
COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_CLASS_PROPERTY_CLASS_METHOD_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS="Should we merge the component/s with similar local component/s. Merging the component/s use to be the default behaviour, but now you can import the component/s and force it not to merge. The following areas (validation_rule, fieldtype, snippet, language, language_translation, joomla_plugin_group, class_extends, class_property, class_method) <b>must and will still</b> merge even of your selection is <b>No</b>, because of the singular nature of those areas."
COM_COMPONENTBUILDER_SHOW_ADVANCED_OPTIONS="Show Advanced Options"
COM_COMPONENTBUILDER_SHOW_IN_ALL_LIST_VIEWS="Show in All List Views"
COM_COMPONENTBUILDER_SHOW_ONLY="Show Only"
COM_COMPONENTBUILDER_SHOW_TOGGLE="Show Toggle"
@ -8376,8 +8476,6 @@ COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE="Site Views Batch Use"
COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch site views"
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE="Site Views Create"
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE_DESC="Allows the users in this group to create create site views"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD="Site Views Dashboard Add"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST="Site Views Dashboard List"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DELETE="Site Views Delete"
@ -8996,6 +9094,8 @@ COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER="S
COM_COMPONENTBUILDER_SORRY_THIS_VALIDATION_RULE_NAME_S_ALREADY_EXIST_AS_PART_OF_THE_JOOMLA_CORE_NO_NEED_TO_CREATE_IT_IF_YOU_ARE_ADAPTING_IT_GIVE_IT_YOUR_OWN_UNIQUE_NAME="Sorry this validation rule name (%s) already exist as part of the Joomla core! No need to create it, if you are adapting it give it your own unique name."
COM_COMPONENTBUILDER_SORRY_THIS_VALIDATION_RULE_NAME_S_ALREADY_EXIST_IN_YOUR_SYSTEM="Sorry this validation rule name (%s) already exist in your system!"
COM_COMPONENTBUILDER_SORTABLE="Sortable"
COM_COMPONENTBUILDER_START_A_SEARCH="Start a Search"
COM_COMPONENTBUILDER_STOP_A_SEARCH="Stop a Search"
COM_COMPONENTBUILDER_SUBMENU="Submenu"
COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS="Admin Views"
COM_COMPONENTBUILDER_SUBMENU_COMPILER="Compiler"
@ -9024,6 +9124,8 @@ COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates"
COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES="Validation Rules"
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved."
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED_BUT_THE_MODIFIED_DATE_COULD_NOT_BE_ADJUSTED_BR_BR_BTHIS_MEANS_THE_SNIPPETS_WILL_CONTINUE_TO_APPEAR_OUT_OF_DATEB="Success! The snippet was saved. But the modified date could not be adjusted. <br /><br /><b>This means the snippets will continue to appear out of date.</b>"
COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY="Support JCB Today"
COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL="Support Joomla Component Builder (JCB) with a <b>financial donation</b> to show gratitude for the time and effort saved in your development process. Your contribution, no matter the size, will be appreciated by the project's team and the wider community. Help ensure the growth and relevance of this essential tool."
COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM="%szdEQzdmVsMHBtRW50T%sQFlvVXJTM3J2IXM="
COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED="%s.zip could not be installed!"
COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION="%s.zip was removed the from tmp folder during installation!"
@ -9180,6 +9282,7 @@ COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVE
COM_COMPONENTBUILDER_THE_BONLY_IN_ADMIN_LIST_VIEWB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_ADMIN_LIST_VIEW_NOT_TO_ANY_LINKED_VIEWS="The <b>Only in Admin List View</b> option will only Add this field to the admin list view, not to any linked views."
COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_LINKED_LIST_VIEW_IF_THIS_VIEW_GETS_LINKED_TO_OTHER_VIEW_NOT_TO_THIS_ADMIN_LIST_VIEW="The <b>Only in Linked List Views</b> option will only Add this field to the linked list view, if this view gets linked to other view, not to this admin list view."
COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The <b>phpseclib\NET\SFTP</b> library\class is not available! This library\class should have been added to your <b>libraries/vdm_io/vendor</b> folder. Please contact your system administrator for more info"
COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT="The <b>%s</b> (<b>%s</b>) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component."
COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING="The <b>%s</b> cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!"
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> path on <b>%s</b> server."
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> server."
@ -9187,12 +9290,13 @@ COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH="The <b>%s</b> is not a vali
COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The <b>%s</b> library\class is not available! This library\class should have been added to your <b>libraries/phpseclib/vendor</b> folder. Please contact your system administrator for more info!"
COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The <b>%s</b> library can not be deleted, or things will break."
COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The <b>%s</b> returned an invalid string!"
COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID="The <b>%s</b> value for the dynamic dashboard is invalid."
COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED="The <b>Show in All List Views</b> option will Add this field to all list views, admin &amp; linked."
COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD="The <b>single filter</b> selection option allows the user to select just one value in this filter/field."
COM_COMPONENTBUILDER_THE_CHANGES_YOU_MAKE_HERE_CAN_NOT_BE_UNDONE_THEREFORE_YOU_MUST_ALWAYS_USE_THE_UPDATE_AND_REPLACE_FEATURES_WITH_GREAT_CAUTION_SEARCH_FEATURE_IS_IN_BETA_STAGE="The changes you make here can not be undone, therefore you must always use the update and replace features with great caution. Search feature is in BETA stage."
COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from <b>%s</b> has been added for the <b>first time</b>. Please <i>investigate</i> to ensure the correct code/string was used! <b>Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention!</b> Do not ignore this warning as it will only show <b>once</b>."
COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from <b>%s</b> has been <b>changed</b> since the last compilation. Please investigate to ensure the changes are safe! <b>Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention!</b> Do not ignore this warning as it will only show <b>once</b>."
COM_COMPONENTBUILDER_THE_COMPONENT="The Component"
COM_COMPONENTBUILDER_THE_COMPONENTS_LAST_MODIFIED_DATE_WILL_BE_USED="The component's last modified date will be used."
COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus"
@ -9206,6 +9310,9 @@ COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS="The component plugins"
COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views"
COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates"
COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL="The Component with all linked admin views, fields linked to admin views, custom admin views, site views, templates and layouts were cloned successful!"
COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="The continued support of individuals like you has allowed Joomla Component Builder (JCB) to thrive for seven years since going public. Your contributions have been crucial in ensuring the growth and relevance of this vital tool for PHP programmers. Thank you for your support and for being a part of JCB's journey."
COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The file path: <b>%s</b> does not exist, and was not added!"
COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The folder path: <b>%s</b> does not exist, and was not added!"
COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for <b>%s</b> could not be made. Please check your signature details!"
COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for <b>%s</b> was not well formed, please check your signature details!"
COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package."
@ -9257,6 +9364,7 @@ COM_COMPONENTBUILDER_TRASHED_ITEMS="Trashed items"
COM_COMPONENTBUILDER_TRASH_AREA="Trash Area"
COM_COMPONENTBUILDER_TUTORIAL_ON_FORKING_JCB_SNIPPETS_BSB="Tutorial on forking JCB snippets: <b>%s</b>"
COM_COMPONENTBUILDER_TUTORIAL_ON_MAKING_A_PULL_REQUEST_BSB="Tutorial on making a pull request: <b>%s</b>"
COM_COMPONENTBUILDER_TWO_SPACES="2 Spaces"
COM_COMPONENTBUILDER_TYPE="Type"
COM_COMPONENTBUILDER_TYPE_ADMIN_CUSTOM_TABS="Admin Custom Tabs"
COM_COMPONENTBUILDER_TYPE_ADMIN_FIELDS="Admin Fields"
@ -9427,19 +9535,29 @@ COM_COMPONENTBUILDER_WEBSITE="Website"
COM_COMPONENTBUILDER_WEBSITE_OF_S="Website of %s"
COM_COMPONENTBUILDER_WEBSITE_S="Website: %s"
COM_COMPONENTBUILDER_WE_DID_NOT_CHECK_THE_SNIPPET_IT_SELF_TO_SEE_IF_IT_CHANGED_WE_ONLY_WORK_ON_DATES="We did not check the snippet it self, to see if it changed. We only work on dates."
COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY="We extend our gratitude to all those who support Joomla Component Builder (JCB), whether as a hobby or as a part of their business. Your contributions, whether financial or in the form of active involvement, have had a significant impact on ensuring the growth and relevance of this vital tool for PHP programmers. We highly value the dedication of hobbyists and the commitment of companies who support JCB, as they have allowed the project to continue its development and maintenance, providing valuable resources for the community. We are grateful for your contributions, no matter how small, and thank you for being a part of the positive impact that JCB has on the PHP programming community."
COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="We extend our heartfelt appreciation to those who have supported the Joomla Component Builder (JCB) project over the years. Your contributions, no matter how big or small, have been instrumental in ensuring its growth and relevance as a vital tool for PHP programmers. Seven years after going public, JCB is still here today because of the support of individuals like you who believe in the importance of this open-source project. Your generosity has allowed the project to continue its development and maintenance, providing valuable resources for the community. Thank you for your unwavering support and for being a part of JCB's journey."
COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="We extend our sincere appreciation to the companies who use Joomla Component Builder (JCB) and support the project. Your contributions, whether financial or in the form of active involvement, have been instrumental in ensuring the growth and relevance of this vital tool for PHP programmers. Your support has allowed JCB to continue its development and maintenance, providing valuable resources for the community. Thank you for your unwavering commitment to the project and for being a part of JCB's journey."
COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move <b>%s</b>!"
COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code <b>all in one line</b>, and ignored it! Please review (%s) for more details!"
COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S="We found some instances in %s"
COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved <b>%s</b>!"
COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET="What version of Joomla would you like to target."
COM_COMPONENTBUILDER_WHICH_TYPE_OF_INDENTATION_WOULD_YOU_LIKE_TO_USE_PLEASE_NOTE_THAT_THIS_DOES_NOT_YET_IMPACT_THE_STATIC_TEMPLATES="Which type of indentation would you like to use? Please note that this does not yet impact the static templates."
COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation"
COM_COMPONENTBUILDER_WHOLE_WORD="Whole Word"
COM_COMPONENTBUILDER_WIKI="Wiki"
COM_COMPONENTBUILDER_WITH="with"
COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY="Without sufficient support, the future of Joomla Component Builder (JCB) is in jeopardy. As a vital tool for PHP programmers, it is crucial to ensure its continued development and maintenance. By making a <b>financial contribution</b>, no matter how small, you are helping to safeguard the future of this open-source project. Neglecting to support JCB could result in its decline and loss as a resource for the community."
COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH="Would you like to do a reverse search?"
COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_OVERRIDE_THE_BUILD_DATE="Would you like to override the build date."
COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH="Would you like to repeat the same search?"
COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_SEE_THE_ADVANCED_COMPILER_OPTIONS="Would you like to see the advanced compiler options?"
COM_COMPONENTBUILDER_YES="Yes"
COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL"
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_REPLACE_BALLB_SEARCH_RESULTS="Your are about to replace <b>ALL</b> search results."
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update <b>ALL</b> values that can be found in the database."
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row"
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3"
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key."
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."
@ -9468,6 +9586,7 @@ COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT="You must select a component!"
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."
COM_COMPONENTBUILDER_YOU_SHOULD_ONLY_CONTINUE_THIS_IMPORT_IF_YOU_HAVE_BACKUP_YOUR_COMPONENTS_AND_INSURED_THAT_THE_PACKAGE_OWNER_IS_REPUTABLE="You should only continue this import if you have backup your components, and insured that the package owner is reputable."
COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB="you will need to know how %s works (basic). You will also need a %s account and know how to make a pull request on github."
COM_COMPONENTBUILDER_YOU_WILL_REPLACE="You will replace"
COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION="Zipped File Location"
COM_COMPONENTBUILDER__ADD_YOUR_PHP_SCRIPT_HERE="// Add your php script here"
COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S="% has been checked out by %s"

View File

@ -85,8 +85,6 @@ COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use"
COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE="Admin Views Create"
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD="Admin Views Dashboard Add"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST="Admin Views Dashboard List"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE="Admin Views Delete"
@ -440,8 +438,6 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE="Custom Admin Views Batch Use"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE="Custom Admin Views Create"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD="Custom Admin Views Dashboard Add"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST="Custom Admin Views Dashboard List"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DELETE="Custom Admin Views Delete"
@ -1022,6 +1018,8 @@ COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access"
COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search."
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access"
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler button."
COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST="Search Dashboard List"
COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Search"
COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu"
COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search"
COM_COMPONENTBUILDER_SERVERS_ACCESS="Servers Access"
@ -1058,8 +1056,6 @@ COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE="Site Views Batch Use"
COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch site views"
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE="Site Views Create"
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE_DESC="Allows the users in this group to create create site views"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD="Site Views Dashboard Add"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST="Site Views Dashboard List"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DELETE="Site Views Delete"

View File

@ -0,0 +1,116 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');
// Different support requests/appreciation
$support = [
JText::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"),
JText::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"),
JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"),
JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"),
JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"),
JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY")
];
// build the support message
$support_message = $support[random_int(0, 8)];
// the button titles
$titles = [
JText::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"),
JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"),
JText::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"),
JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"),
JText::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"),
JText::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"),
JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"),
JText::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"),
JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"),
JText::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"),
JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"),
JText::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"),
JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"),
JText::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"),
JText::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"),
JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"),
JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"),
JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"),
JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"),
JText::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"),
JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"),
JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"),
JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"),
JText::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"),
JText::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"),
JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"),
JText::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"),
JText::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS")
];
// build the support button
$support_titles = $titles[random_int(0, 29)];
// the button names
$button_names = [
JText::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"),
JText::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"),
JText::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"),
JText::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"),
JText::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"),
JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"),
JText::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"),
JText::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"),
JText::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"),
JText::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"),
JText::_("COM_COMPONENTBUILDER_EMPOWER_JCB"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"),
JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"),
JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"),
JText::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"),
JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"),
JText::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"),
JText::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"),
JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"),
JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"),
JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY")
];
// build the support button
$support_button = $button_names[random_int(0, 32)];
?>
<?php echo $support_message; ?>
<br /><br />
<img src="https://opencollective.com/joomla-component-builder/tiers/badge.svg" />
<br /><br />
<a class="btn btn-mini btn-success" href="https://opencollective.com/joomla-component-builder/donate?interval=month&amount=20" title="<?php echo $support_titles; ?>" trage="_blank">
<?php echo $support_button; ?>
</a>
<br />

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm();
// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model method
// this name combination of tab and layout in the method name is the only work around
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'autoload_composer_note',
'composer'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
</div>
<?php endif; ?>

View File

@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use Joomla\Registry\Registry;
use VDM\Gitea\Gitea;
use Joomla\Registry\Registry;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
/**

View File

@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use Joomla\Registry\Registry;
use VDM\Gitea\Gitea;
use Joomla\Registry\Registry;
/**
* Componentbuilder List Model
@ -30,13 +30,15 @@ class ComponentbuilderModelComponentbuilder extends ListModel
$icons = array();
// view groups array
$viewGroups = array(
'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.servers', 'png.help_documents')
'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png.search', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.admin_views', 'png.custom_admin_views', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.servers', 'png.help_documents')
);
// view access array
$viewAccess = array(
'compiler.submenu' => 'compiler.submenu',
'compiler.dashboard_list' => 'compiler.dashboard_list',
'search.access' => 'search.access',
'search.submenu' => 'search.submenu',
'search.dashboard_list' => 'search.dashboard_list',
'get_snippets.submenu' => 'get_snippets.submenu',
'get_snippets.dashboard_list' => 'get_snippets.dashboard_list',
'joomla_component.create' => 'joomla_component.create',
@ -64,17 +66,14 @@ class ComponentbuilderModelComponentbuilder extends ListModel
'admin_view.access' => 'admin_view.access',
'admin_views.submenu' => 'admin_view.submenu',
'admin_views.dashboard_list' => 'admin_view.dashboard_list',
'admin_view.dashboard_add' => 'admin_view.dashboard_add',
'custom_admin_views.access' => 'custom_admin_view.access',
'custom_admin_view.access' => 'custom_admin_view.access',
'custom_admin_views.submenu' => 'custom_admin_view.submenu',
'custom_admin_views.dashboard_list' => 'custom_admin_view.dashboard_list',
'custom_admin_view.dashboard_add' => 'custom_admin_view.dashboard_add',
'site_views.access' => 'site_view.access',
'site_view.access' => 'site_view.access',
'site_views.submenu' => 'site_view.submenu',
'site_views.dashboard_list' => 'site_view.dashboard_list',
'site_view.dashboard_add' => 'site_view.dashboard_add',
'templates.access' => 'template.access',
'template.access' => 'template.access',
'templates.submenu' => 'template.submenu',

View File

@ -186,22 +186,6 @@
</field>
<!-- Load_powers_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="load_powers_note" label="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_DESCRIPTION" heading="h4" class="alert alert-info load_powers_note" />
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Description Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -227,6 +211,63 @@
validate="code"
showon="add_licensing_template:2"
/>
<!-- Composer Field. Type: Subform. (joomla) -->
<field
type="subform"
name="composer"
label="COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="1"
min="0">
<form hidden="true" name="list_composer_modal" repeat="true">
<!-- Access_point Field. Type: Text. (joomla) -->
<field
type="text"
name="access_point"
label="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL"
size="70"
maxlength="300"
description="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION"
class="text_area"
required="true"
filter="PATH"
message="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT"
/>
<!-- Namespace Field. Type: Subform. (joomla) -->
<field
type="subform"
name="namespace"
label="COM_COMPONENTBUILDER_POWER_NAMESPACE_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="30"
min="1"
nested_depth="1">
<form hidden="true" name="list_namespace_modal" repeat="true">
<!-- Use Field. Type: Text. (joomla) -->
<field
type="text"
name="use"
label="COM_COMPONENTBUILDER_POWER_USE_LABEL"
size="70"
maxlength="300"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_POWER_USE_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_USE_HINT"
autocomplete="on"
/>
</form>
</field>
</form>
</field>
<!-- Property_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -372,21 +413,8 @@
required="false"
validate="code"
/>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Autoload_composer_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="autoload_composer_note" label="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION" heading="h4" class="alert alert-info autoload_composer_note" />
<!-- Use_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -397,9 +425,8 @@
buttons="add,remove,move"
description="COM_COMPONENTBUILDER_POWER_USE_SELECTION_DESCRIPTION"
icon="list"
max="30"
min="0"
showon="type!:interface">
max="100"
min="0">
<form hidden="true" name="list_use_selection_modal" repeat="true">
<!-- Use Field. Type: Namespaces. (custom) -->
<field
@ -425,6 +452,37 @@
/>
</form>
</field>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Guid Field. Type: Text. (joomla) -->
<field
type="text"

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
/**
* Joomla_components List Model

View File

@ -64,6 +64,12 @@ class ComponentbuilderModelPower extends AdminModel
'add_licensing_template',
'licensing_template'
)
),
'composer' => array(
'fullwidth' => array(
'autoload_composer_note',
'composer'
)
)
);
@ -178,12 +184,6 @@ class ComponentbuilderModelPower extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->licensing_template))
{
// base64 Decode licensing_template.
@ -196,6 +196,12 @@ class ComponentbuilderModelPower extends AdminModel
$item->head = base64_decode($item->head);
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->load_selection))
{
// Convert the load_selection field to an array.
@ -204,6 +210,14 @@ class ComponentbuilderModelPower extends AdminModel
$item->load_selection = $load_selection->toArray();
}
if (!empty($item->composer))
{
// Convert the composer field to an array.
$composer = new Registry;
$composer->loadString($item->composer);
$item->composer = $composer->toArray();
}
if (!empty($item->property_selection))
{
// Convert the property_selection field to an array.
@ -1050,6 +1064,19 @@ class ComponentbuilderModelPower extends AdminModel
$data['load_selection'] = '';
}
// Set the composer items to data.
if (isset($data['composer']) && is_array($data['composer']))
{
$composer = new JRegistry;
$composer->loadArray($data['composer']);
$data['composer'] = (string) $composer;
}
elseif (!isset($data['composer']))
{
// Set the empty composer to data
$data['composer'] = '';
}
// Set the property_selection items to data.
if (isset($data['property_selection']) && is_array($data['property_selection']))
{
@ -1102,12 +1129,6 @@ class ComponentbuilderModelPower extends AdminModel
$data['use_selection'] = '';
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the licensing_template string to base64 string.
if (isset($data['licensing_template']))
{
@ -1119,6 +1140,12 @@ class ComponentbuilderModelPower extends AdminModel
{
$data['head'] = base64_encode($data['head']);
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))

View File

@ -180,7 +180,8 @@ class ComponentbuilderModelSearch extends ItemModel
'replace_value' => SearchFactory::_('Config')->get('replace_value', ''),
'match_case' => SearchFactory::_('Config')->get('match_case', 0),
'whole_word' => SearchFactory::_('Config')->get('whole_word', 0),
'regex_search' => SearchFactory::_('Config')->get('regex_search', 0)
'regex_search' => SearchFactory::_('Config')->get('regex_search', 0),
'table_name' => SearchFactory::_('Config')->get('table_name', -1)
];
if (empty($data))

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_power` ADD `composer` TEXT NOT NULL AFTER `add_licensing_template`;

View File

@ -139,13 +139,8 @@ jQuery('<div id="compiling"></div>')
<div id="compilerForm">
<div>
<span class="notice" style="display:none; color:red;"><?php echo JText::_('COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT'); ?></span><br />
<?php if ($this->Form): ?>
<?php foreach ($this->Form as $field): ?>
<div class="control-group">
<div class="control-label"><?php echo $field->label; ?></div>
<div class="controls"><?php echo $field->input; ?></div>
</div>
<?php endforeach; ?>
<?php if ($this->form): ?>
<?php echo $this->form->renderFieldset('builder'); ?>
<?php endif; ?>
</div>
<br />
@ -158,6 +153,7 @@ jQuery('<div id="compiling"></div>')
</div>
</div>
<div class="span7">
<div id="advance-details"><?php echo $this->form->renderFieldset('advanced'); ?></div>
<div id="component-details"><?php echo $selectNotice; ?></div>
<?php echo JLayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
</div>

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Form\Form;
/**
* Componentbuilder Html View class for the Compiler
@ -47,7 +48,7 @@ class ComponentbuilderViewCompiler extends HtmlView
$this->Components = $this->get('Components');
// get the needed form fields
$this->Form = $this->getDynamicForm();
$this->form = $this->getDynamicForm();
// set the compiler artwork from global settings
$this->builder_gif_size = $this->params->get('builder_gif_size', '480-272');
@ -106,119 +107,378 @@ class ComponentbuilderViewCompiler extends HtmlView
/**
* Get the dynamic build form fields needed on the page
*
* @return array|null The array of form fields
* @return Form|null The form fields
*
* @since 3.2.0
*/
public function getDynamicForm(): ?array
public function getDynamicForm(): ?Form
{
if(ComponentbuilderHelper::checkArray($this->Components))
{
// start the form
$form = array();
$form = new Form('Builder');
$form->load('<form
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields">
<fieldset name="builder"></fieldset>
<fieldset name="advanced"></fieldset>
</form>');
// sales attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET',
'default' => '0');
'default' => '0'];
// set the sales options
$options = array(
$options = [
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 0, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// repository attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'repository',
'label' => 'COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER',
'default' => '1');
'default' => '1'];
// start the repository options
$options = array(
$options = [
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 1, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// placeholders attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'add_placeholders',
'label' => 'COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE',
'default' => '2');
'default' => '2'];
// start the placeholders options
$options = array(
$options = [
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// debuglinenr attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'debug_line_nr',
'label' => 'COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING',
'default' => '2');
$options = array(
'default' => '2'];
$options = [
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// minify attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'minify',
'label' => 'COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT',
'default' => '2');
$options = array(
'default' => '2'];
$options = [
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// powers attributes
$attributes = array(
$attributes = [
'type' => 'radio',
'name' => 'powers',
'label' => 'COM_COMPONENTBUILDER_ADD_POWERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_ADD_ANY_POWERS_THAT_ARE_CONNECTED_TO_THIS_COMPONENT_THIS_MAY_BE_HELPFUL_IF_YOU_ARE_LOADING_POWERS_VIA_ANOTHER_COMPONENT_AND_WOULD_LIKE_TO_AVOID_ADDING_IT_TO_BOTH_JUST_REMEMBER_THAT_IN_THIS_CASE_YOU_NEED_TO_LOAD_THE_POWERS_VIA_A_PLUGIN',
'default' => '2');
$options = array(
'default' => '2'];
$options = [
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// component attributes
$attributes = array(
$attributes = [
'type' => 'list',
'name' => 'component_id',
'label' => 'COM_COMPONENTBUILDER_COMPONENTS',
'class' => 'list_class',
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE',
'required' => 'true');
'required' => 'true'];
// start the component options
$options = array();
$options = [];
$options[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_';
// load component options from array
foreach($this->Components as $component)
{
$options[(int) $component->id] = $this->escape($component->name);
}
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, '', $options);
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Advanced Options
$attributes = [
'type' => 'radio',
'name' => 'show_advanced_options',
'label' => 'COM_COMPONENTBUILDER_SHOW_ADVANCED_OPTIONS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_SEE_THE_ADVANCED_COMPILER_OPTIONS',
'default' => '0'];
// start the advanced options switch
$options = [
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Advanced Options note attributes
$attributes = [
'type' => 'note',
'name' => 'show_advanced_options_note',
'label' => "COM_COMPONENTBUILDER_ADVANCED_OPTIONS",
'heading' => 'h3',
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Versions attributes
$attributes = [
'type' => 'radio',
'name' => 'joomla_version_donations',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET',
'default' => '3',
'showon' => 'show_advanced_options:1'];
// start the joomla versions options
$options = [
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Version 3 attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_three',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE',
'class' => 'alert alert-success',
'showon' => 'show_advanced_options:1[AND]joomla_version_donations:3'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Version 4 attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_four',
'description' => 'COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB',
'class' => 'alert alert-info',
'showon' => 'show_advanced_options:1[AND]joomla_version_donations:4'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Indentation attributes
$attributes = [
'type' => 'radio',
'name' => 'indentation_value',
'label' => 'COM_COMPONENTBUILDER_INDENTATION_OPTIONS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_WHICH_TYPE_OF_INDENTATION_WOULD_YOU_LIKE_TO_USE_PLEASE_NOTE_THAT_THIS_DOES_NOT_YET_IMPACT_THE_STATIC_TEMPLATES',
'default' => '1',
'showon' => 'show_advanced_options:1'];
// start the indentation options
$options = [
'1' => 'COM_COMPONENTBUILDER_TAB',
'2' => 'COM_COMPONENTBUILDER_TWO_SPACES',
'4' => 'COM_COMPONENTBUILDER_FOUR_SPACES'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date attributes
$attributes = [
'type' => 'radio',
'name' => 'add_build_date',
'label' => 'COM_COMPONENTBUILDER_BUILD_DATE',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_OVERRIDE_THE_BUILD_DATE',
'default' => '1',
'showon' => 'show_advanced_options:1'];
// start the build date options
$options = [
'1' => 'COM_COMPONENTBUILDER_DEFAULT',
'2' => 'COM_COMPONENTBUILDER_MANUAL',
'3' => 'COM_COMPONENTBUILDER_COMPONENT'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date note attributes
$attributes = [
'type' => 'note',
'name' => 'add_build_date_note_two',
'description' => 'COM_COMPONENTBUILDER_ALLOWS_YOU_TO_OVERRIDE_THE_BUILD_DATE_BY_SELECTING_A_DATE_MANUALLY_FROM_THE_CALENDER',
'class' => 'alert alert-info',
'showon' => 'show_advanced_options:1[AND]add_build_date:2'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date note attributes
$attributes = [
'type' => 'note',
'name' => 'add_build_date_note_three',
'description' => "COM_COMPONENTBUILDER_THE_COMPONENTS_LAST_MODIFIED_DATE_WILL_BE_USED",
'class' => 'alert alert-info',
'showon' => 'show_advanced_options:1[AND]add_build_date:3'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date calendar attributes
$attributes = [
'type' => 'calendar',
'name' => 'build_date',
'label' => 'COM_COMPONENTBUILDER_SELECT_BUILD_DATE',
'format' => '%Y-%m-%d',
'filter' => 'user_utc',
'default' => 'now',
'size' => '22',
'showon' => 'show_advanced_options:1[AND]add_build_date:2'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date note attributes
$attributes = [
'type' => 'note',
'name' => 'donations_note',
'label' => "COM_COMPONENTBUILDER_DONATIONS",
'description' => $this->getSupportMessage(),
'class' => 'alert alert-success',
'heading' => 'h1',
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Build date note line attributes
$attributes = [
'type' => 'note',
'name' => 'donations_note_line',
'description' => '<hr />',
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// return the form array
return $form;
@ -226,6 +486,18 @@ class ComponentbuilderViewCompiler extends HtmlView
return null;
}
/**
* Get the dynamic support request/gratitude message
*
* @return string The support message
*
* @since 3.2.0
*/
protected function getSupportMessage(): string
{
return JLayoutHelper::render('jcbsupportmessage', []);
}
/**

View File

@ -92,7 +92,6 @@ class ComponentbuilderViewGet_snippets extends HtmlView
{
// Set the default uikit components in this view.
$uikitComp = array();
$uikitComp[] = 'UIkit.notify';
$uikitComp[] = 'data-uk-grid';
}

View File

@ -64,6 +64,16 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'composer', JText::_('COM_COMPONENTBUILDER_POWER_COMPOSER', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('power.composer_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'licensing', JText::_('COM_COMPONENTBUILDER_POWER_LICENSING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>

View File

@ -22,7 +22,10 @@ $this->app->input->set('hidemainmenu', false);
// set the basu URL
$url_base = JUri::base() . 'index.php?option=com_componentbuilder';
$url_search = $url_base . '&view=search';
$url_search = $url_base . '&view=search';
// get main search input field
$search_value = $this->form->getField('search_value');
?>
<?php if ($this->canDo->get('search.access')): ?>
<script type="text/javascript">
@ -39,10 +42,6 @@ $url_search = $url_base . '&view=search';
</script>
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
<div class="alert alert-warning" role="alert">
<?php echo JText::_('COM_COMPONENTBUILDER_THE_CHANGES_YOU_MAKE_HERE_CAN_NOT_BE_UNDONE_THEREFORE_YOU_MUST_ALWAYS_USE_THE_UPDATE_AND_REPLACE_FEATURES_WITH_GREAT_CAUTION_SEARCH_FEATURE_IS_IN_BETA_STAGE'); ?>
</div>
<hr />
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -74,16 +73,42 @@ $url_search = $url_base . '&view=search';
<span class="search_details_title"><?php echo JText::_('COM_COMPONENTBUILDER_REPLACED_WITH'); ?></span>:
&nbsp;[<span id="replaced" class="found_code">....</span>]
</span>
<button style="float: right;" type="button" onclick="showSearch();" class="btn button-new btn-success">
<span class="icon-search icon-white" aria-hidden="true"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_SEARCH_DATABASE_AGAIN'); ?>
</button>
<div class="btn-group" style="float: right;">
<button style="display: none;" type="button" onclick="replaceAllCheck();" class="update_all_block hasTooltip btn button-new btn-danger"
title="<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE'); ?>">
<span class="icon-database icon-white" aria-hidden="true"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL'); ?>
</button>
<button type="button" onclick="showSearch();" class="btn button-new btn-success">
<span class="icon-search icon-white" aria-hidden="true"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_SEARCH_DATABASE_AGAIN'); ?>
</button>
</div>
</div>
<div class="row-fluid" id="search_settings_block">
<div class="span7">
<?php echo $this->form->renderField('type_search'); ?>
<?php echo $this->form->renderField('search_value'); ?>
<div class="btn-wrapper input-append">
<?php echo $search_value->input; ?>
<button id="start_search_button" onclick="startSearch(this, true);" type="button" class="btn hasTooltip"
title="<?php echo JHtml::_('tooltipText', 'COM_COMPONENTBUILDER_START_A_SEARCH'); ?>"
aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_START_A_SEARCH'); ?>">
<span class="icon-search" aria-hidden="true"></span>
</button>
<button id="stop_search_button" onclick="stopSearch();" type="button" class="btn btn-danger hasTooltip" style="display: none"
title="<?php echo JHtml::_('tooltipText', 'COM_COMPONENTBUILDER_STOP_A_SEARCH'); ?>"
aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_STOP_A_SEARCH'); ?>">
<span class="icon-stop" aria-hidden="true"></span>
</button>
</div>
<?php echo $this->form->renderField('replace_value'); ?>
<div class="update_all_block" style="display: none;">
<button type="button" onclick="replaceAllCheck();" class="hasTooltip btn btn-small button-new btn-danger span11"
title="<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE'); ?>">
<span class="icon-database icon-white" aria-hidden="true"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL'); ?>
</button>
</div>
</div>
<div class="span4">
<?php echo $this->form->renderFieldset('settings'); ?>
@ -96,32 +121,26 @@ $url_search = $url_base . '&view=search';
</div>
</div>
<div class="row-fluid" id="item_view_block">
<hr>
<div>
<span id="item_notice_block" style="display: none">
<span id="item_edit_button"></span>&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_TABLE'); ?>:&nbsp;<b><span id="item_table_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_ID'); ?>:<b><span id="item_row_id">
</span></b>)&nbsp;|&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD'); ?>:&nbsp;<b><span id="item_field_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_LINE'); ?>:<b><span id="item_line_number">
</span></b>)&nbsp;&nbsp;&nbsp;
<button type="button" id="item_button_update" onclick="" class="hasTooltip btn btn-small button-new btn-success"
title="<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ALL_CHANGES_MADE_TO_THE_SELECTED_ITEM'); ?>">
<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ITEM'); ?>
</button>
</span>
<span id="update_all_block" style="display: none;">
<button style="float: right;" type="button" onclick="replaceAllCheck();" class="hasTooltip btn btn-small button-new btn-danger"
title="<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE'); ?>">
<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL'); ?>
</button>
</span>
<div id="item_notice_block" style="display: none">
<hr>
<span id="item_edit_button"></span>&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_TABLE'); ?>:&nbsp;<b><span id="item_table_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_ID'); ?>:<b><span id="item_row_id">
</span></b>)&nbsp;|&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD'); ?>:&nbsp;<b><span id="item_field_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_LINE'); ?>:<b><span id="item_line_number">
</span></b>)&nbsp;&nbsp;&nbsp;
<button type="button" id="item_button_update" onclick="" class="hasTooltip btn btn-small button-new btn-success"
title="<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ALL_CHANGES_MADE_TO_THE_SELECTED_ITEM'); ?>">
<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ITEM'); ?>
</button>
</div>
<hr>
<?php echo $this->form->getInput('item_code'); ?>
</div>
</div>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<?php endif; ?>
</div>
@ -174,6 +193,10 @@ const typeReplaceObject = document.getElementById("type_search1");
const typeSearchLabelObject = document.querySelector('[for=type_search0]');
const typeReplaceLabelObject = document.querySelector('[for=type_search1]');
// search buttons
const startSearchButton = document.getElementById("start_search_button");
const stopSearchButton = document.getElementById("stop_search_button");
// set the search settings objects
const searchObject = document.getElementById("search_value");
const replaceObject = document.getElementById("replace_value");
@ -183,17 +206,17 @@ const regexObject = document.getElementById("search_behaviour2");
const tableObject = document.getElementById("table_name");
// Do the search on key up of search or replace input elements
searchObject.onkeyup = onChange;
searchObject.onkeyup = startSearch;
// when the made changes and there is replace value do search
modeObject.onchange = onChange;
replaceObject.onkeyup = onChange;
modeObject.onchange = startSearch;
replaceObject.onkeyup = startSearch;
// Do the search on key up of search input elements
matchObject.onchange = onChange;
wholeObject.onchange = onChange;
regexObject.onchange = onChange;
tableObject.onchange = onChange;
matchObject.onchange = startSearch;
wholeObject.onchange = startSearch;
regexObject.onchange = startSearch;
tableObject.onchange = startSearch;
// set the item notice area
const itemNoticeObject = document.getElementById("item_notice_block");
@ -205,7 +228,7 @@ const itemLineNumberObject = document.getElementById("item_line_number");
// set the update buttons
const buttonUpdateItemObject = document.getElementById("item_button_update");
const buttonUpdateAllObject = document.getElementById("update_all_block");
const buttonUpdateAllObject = document.querySelectorAll(".update_all_block");
// get the editor
var editorObject;
@ -222,8 +245,10 @@ const tableConfigObject = {
order: [[ 2, "asc" ]],
select: true,
paging: true,
deferRender: true,
lengthMenu: [5, 10, 20 ,50, 80, 100, 150, 200, 500, 1000, 1500, 2000],
pageLength: 80,
// pagingType: "scrolling", // NOT YET
scrollY: 170,
columnDefs: [
{ 'targets': [ 0 ], 'visible': false, 'searchable': false },
@ -304,8 +329,8 @@ document.addEventListener('DOMContentLoaded', function () {
tableLengthObject = document.getElementById("search_results_table_length");
showSearch();
<?php if (strlen($this->urlvalues['search_value']) > 2): ?>
onChange();
<?php if (strlen($this->urlvalues['search_value']) > 0): ?>
startSearch(null, true);
<?php endif; ?>
});
</script>

View File

@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Form\Form;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
use Joomla\CMS\Form\Form;
/**
* Componentbuilder Html View class for the Search
@ -62,7 +62,9 @@ class ComponentbuilderViewSearch extends HtmlView
JText::script('COM_COMPONENTBUILDER_FIELD_IN_THE');
JText::script('COM_COMPONENTBUILDER_TABLE');
JText::script('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE');
JText::script('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_REPLACE_BALLB_SEARCH_RESULTS');
JText::script('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE');
JText::script('COM_COMPONENTBUILDER_YOU_WILL_REPLACE');
JText::script('COM_COMPONENTBUILDER_WITH');
JText::script('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB');
JText::script('COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE');
JText::script('COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE');
@ -127,6 +129,7 @@ class ComponentbuilderViewSearch extends HtmlView
$attributes = [
'type' => 'radio',
'name' => 'type_search',
'hiddenLabel' => true,
'label' => 'COM_COMPONENTBUILDER_MODE',
'class' => 'btn-group',
'description' => 'COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE',
@ -134,7 +137,8 @@ class ComponentbuilderViewSearch extends HtmlView
// set the mode options
$options = [
1 => 'COM_COMPONENTBUILDER_SEARCH',
2 => 'COM_COMPONENTBUILDER_REPLACE'];
2 => 'COM_COMPONENTBUILDER_REPLACE',
0 => 'COM_COMPONENTBUILDER_CLEAR'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
@ -146,12 +150,13 @@ class ComponentbuilderViewSearch extends HtmlView
$attributes = [
'type' => 'text',
'name' => 'search_value',
'hiddenLabel' => true,
'label' => 'COM_COMPONENTBUILDER_SEARCH',
'size' => 150,
'maxlength' => 200,
'description' => 'COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_YOUR_SEARCH_TEXT',
'filter' => 'RAW',
'class' => 'search-value span12',
'class' => 'search-value span11',
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT',
'autocomplete' => true,
'default' => $this->urlvalues['search_value']];
@ -166,12 +171,13 @@ class ComponentbuilderViewSearch extends HtmlView
$attributes = [
'type' => 'text',
'name' => 'replace_value',
'hiddenLabel' => true,
'label' => 'COM_COMPONENTBUILDER_REPLACE',
'size' => 150,
'maxlength' => 200,
'description' => 'COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_THE_REPLACE_TEXT_THAT_YOU_WOULD_LIKE_TO_USE_AS_REPLACEMENT_FOR_THE_SEARCH_TEXT_FOUND',
'filter' => 'RAW',
'class' => 'replace-value span12',
'class' => 'replace-value span11',
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT',
'autocomplete' => true,
'showon' => 'type_search:2',
@ -252,7 +258,7 @@ class ComponentbuilderViewSearch extends HtmlView
'class' => 'list_class',
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_TABLE_TO_SEARCH',
'required' => 'true',
'default' => -1];
'default' => $this->urlvalues['table_name']];
// start the component options
$options = [];
$options['-1'] = 'COM_COMPONENTBUILDER__SEARCH_ALL_';

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>4th November, 2022</creationDate>
<creationDate>12th February, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.1.11</version>
<version>3.1.17</version>
<description><![CDATA[
<h1>Component Builder (v.3.1.11)</h1>
<h1>Component Builder (v.3.1.17)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
@ -75,11 +75,11 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
<submenu>
<!-- Instead of link you can specify individual link attributes -->
<menu option="com_componentbuilder" view="compiler">COM_COMPONENTBUILDER_MENU_COMPILER</menu>
<menu option="com_componentbuilder" view="search">COM_COMPONENTBUILDER_MENU_SEARCH</menu>
<menu option="com_componentbuilder" view="joomla_components">COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS</menu>
<menu option="com_componentbuilder" view="joomla_modules">COM_COMPONENTBUILDER_MENU_JOOMLA_MODULES</menu>
<menu option="com_componentbuilder" view="joomla_plugins">COM_COMPONENTBUILDER_MENU_JOOMLA_PLUGINS</menu>
<menu option="com_componentbuilder" view="powers">COM_COMPONENTBUILDER_MENU_POWERS</menu>
<menu option="com_componentbuilder" view="search">COM_COMPONENTBUILDER_MENU_SEARCH</menu>
<menu option="com_componentbuilder" view="admin_views">COM_COMPONENTBUILDER_MENU_ADMIN_VIEWS</menu>
<menu option="com_componentbuilder" view="custom_admin_views">COM_COMPONENTBUILDER_MENU_CUSTOM_ADMIN_VIEWS</menu>
<menu option="com_componentbuilder" view="site_views">COM_COMPONENTBUILDER_MENU_SITE_VIEWS</menu>

View File

@ -1097,10 +1097,28 @@
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.1.11</version>
<version>3.1.12</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.11.zip</downloadurl>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.12.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.1.17</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.17.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -58,7 +58,7 @@ abstract class AbstractGiteaObject
$this->options = $options ?: new Registry;
$this->client = $client ?: (new HttpFactory)->getHttp($this->options);
$this->package = \get_class($this);
$this->package = static::class;
$this->package = substr($this->package, strrpos($this->package, '\\') + 1);
}
@ -83,7 +83,7 @@ abstract class AbstractGiteaObject
if ($this->options->get('access.token', false))
{
// Use oAuth authentication
$headers = $this->client->getOption('headers', array());
$headers = $this->client->getOption('headers', []);
if (!isset($headers['Authorization']))
{
@ -137,7 +137,7 @@ abstract class AbstractGiteaObject
if ($response->code != $expectedCode)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
$error = json_decode((string) $response->body);
$message = isset($error->message) ? $error->message : 'Invalid response received from Gitea.';
throw new \DomainException($message, $response->code);
@ -145,11 +145,11 @@ abstract class AbstractGiteaObject
if (JsonHelper::check($response->body))
{
$body = json_decode($response->body);
$body = json_decode((string) $response->body);
if (isset($body->content_base64))
{
$body->content = base64_decode($body->content_base64);
$body->content = base64_decode((string) $body->content_base64);
}
}
else

View File

@ -30,7 +30,7 @@ abstract class AbstractPackage extends AbstractGiteaObject
{
parent::__construct($options, $client);
$this->package = \get_class($this);
$this->package = static::class;
$this->package = substr($this->package, strrpos($this->package, '\\') + 1);
}

View File

@ -70,7 +70,7 @@ class Wiki extends AbstractPackage
$path = '/markdown';
// Get headers
$headers = $this->client->getOption('headers', array());
$headers = $this->client->getOption('headers', []);
$headers['accept'] = 'text/html';
$headers['Content-Type'] = 'application/json';

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -32,7 +32,7 @@ abstract class BaseConfig extends JoomlaRegistry
* @var Input
* @since 3.2.0
*/
protected $input;
protected Input $input;
/**
* The Params
@ -66,12 +66,12 @@ abstract class BaseConfig extends JoomlaRegistry
/**
* setting any config value
*
* @param String $key The value's key/path name
* @param string $key The value's key/path name
* @param mixed $value Optional default value, returned if the internal value is null.
*
* @since 3.2.0
*/
public function __set($key, $value)
public function __set(string $key, $value)
{
$this->set($key, $value);
}
@ -79,12 +79,12 @@ abstract class BaseConfig extends JoomlaRegistry
/**
* getting any valid value
*
* @param String $key The value's key/path name
* @param string $key The value's key/path name
*
* @since 3.2.0
* @throws \InvalidArgumentException If $key is not a valid function name.
*/
public function __get($key)
public function __get(string $key)
{
// check if it has been set
if (($value = $this->get($key, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
@ -98,7 +98,7 @@ abstract class BaseConfig extends JoomlaRegistry
/**
* Get a config value.
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
* @param string $path Registry path (e.g. joomla_content_showauthor)
* @param mixed $default Optional default value, returned if the internal value is null.
*
* @return mixed Value of entry or null
@ -108,7 +108,7 @@ abstract class BaseConfig extends JoomlaRegistry
public function get($path, $default = null)
{
// function name with no underscores
$method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path)));
$method = 'get' . ucfirst((string) ClassfunctionHelper::safe(str_replace('_', '', $path)));
// check if it has been set
if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
@ -117,7 +117,7 @@ abstract class BaseConfig extends JoomlaRegistry
}
elseif (method_exists($this, $method))
{
$value = $this->{$method}();
$value = $this->{$method}($default);
$this->set($path, $value);
@ -126,6 +126,27 @@ abstract class BaseConfig extends JoomlaRegistry
return $default;
}
/**
* Append value to a path in registry of an array
*
* @param string $path Parent registry Path (e.g. joomla.content.showauthor)
* @param mixed $value Value of entry
*
* @return mixed The value of the that has been set.
*
* @since 3.2.0
*/
public function appendArray(string $path, $value)
{
// check if it does not exist
if (!$this->exists($path))
{
$this->set($path, []);
}
return $this->append($path, $value);
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -29,11 +29,11 @@ abstract class BaseRegistry extends JoomlaRegistry implements \JsonSerializable,
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
*
* @return \ArrayIterator This object represented as an ArrayIterator.
* @return \ArrayIterator|null This object represented as an ArrayIterator.
*
* @since 3.4.0
*/
public function _($path)
public function _(string $path): ?\ArrayIterator
{
$data = $this->extract($path);
@ -44,6 +44,107 @@ abstract class BaseRegistry extends JoomlaRegistry implements \JsonSerializable,
return $data->getIterator();
}
/**
* Append value to a path in registry of an array
*
* @param string $path Parent registry Path (e.g. joomla.content.showauthor)
* @param mixed $value Value of entry
*
* @return mixed The value of the that has been set.
*
* @since 3.2.0
*/
public function appendArray(string $path, $value)
{
// check if it does not exist
if (!$this->exists($path))
{
$this->set($path, []);
}
return $this->append($path, $value);
}
/**
* Check if a registry path exists and is an array
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
*
* @return boolean
*
* @since 3.2.0
*/
public function isArray(string $path): bool
{
// Return default value if path is empty
if (empty($path)) {
return false;
}
// get the value
if (($node = $this->get($path)) !== null
&& is_array($node)
&& $node !== [])
{
return true;
}
return false;
}
/**
* Check if a registry path exists and is a string
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
*
* @return boolean
*
* @since 3.2.0
*/
public function isString(string $path): bool
{
// Return default value if path is empty
if (empty($path)) {
return false;
}
// get the value
if (($node = $this->get($path)) !== null
&& is_string($node)
&& strlen((string) $node) > 0)
{
return true;
}
return false;
}
/**
* Check if a registry path exists and is numeric
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
*
* @return boolean
*
* @since 3.2.0
*/
public function isNumeric(string $path): bool
{
// Return default value if path is empty
if (empty($path)) {
return false;
}
// get the value
if (($node = $this->get($path)) !== null
&& is_numeric($node))
{
return true;
}
return false;
}
}

View File

@ -0,0 +1,108 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Abstraction;
use Joomla\CMS\Factory as JoomlaFactory;
use VDM\Joomla\Utilities\Component\Helper;
/**
* Database
*
* @since 3.2.0
*/
abstract class Database
{
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
*/
protected \JDatabaseDriver $db;
/**
* Core Component Table Name
*
* @var string
* @since 3.2.0
*/
protected string $table;
/**
* Constructor
*
* @param \JDatabaseDriver|null $db The database driver
*
* @throws \Exception
* @since 3.2.0
*/
public function __construct(?\JDatabaseDriver $db = null)
{
$this->db = $db ?: JoomlaFactory::getDbo();
// set the component table
$this->table = '#__' . Helper::getCode();
}
/**
* Set a value based on data type
*
* @param mixed $value The value to set
*
* @return mixed
* @since 3.2.0
**/
protected function quote($value)
{
if (is_numeric($value))
{
if (filter_var($value, FILTER_VALIDATE_INT))
{
return (int) $value;
}
elseif (filter_var($value, FILTER_VALIDATE_FLOAT))
{
return (float) $value;
}
}
elseif (is_bool($value))
{
return (int) $value;
}
// default just escape it
return $this->db->quote($value);
}
/**
* Set a table name, adding the
* core component as needed
*
* @param string $table The table string
*
* @return string
* @since 3.2.0
**/
protected function getTable(string $table): string
{
if (strpos($table, '#__') === false)
{
return $this->table . '_' . $table;
}
return $table;
}
}

View File

@ -0,0 +1,258 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Abstraction;
use VDM\Joomla\Componentbuilder\Interfaces\Mapperdoubleinterface;
use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface;
/**
* Compiler Mapper
*
* @since 3.2.0
*/
abstract class Mapper implements Mapperdoubleinterface, Mappersingleinterface
{
/**
* The Content
*
* @var array
* @since 3.2.0
**/
public array $active = [];
/**
* Set content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function set(string $key, $value)
{
$this->active[$this->key($key)] = $value;
}
/**
* Get content
*
* @param string $key The main string key
*
* @return mixed
* @since 3.2.0
*/
public function get(string $key)
{
return $this->active[$this->key($key)] ?? null;
}
/**
* Does key exist
*
* @param string $key The main string key
*
* @return bool
* @since 3.2.0
*/
public function exist(string $key): bool
{
if (isset($this->active[$this->key($key)]))
{
return true;
}
return false;
}
/**
* Add content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function add(string $key, $value)
{
if (isset($this->active[$this->key($key)]))
{
$this->active[$this->key($key)] .= $value;
}
else
{
$this->active[$this->key($key)] = $value;
}
}
/**
* Remove content
*
* @param string $key The main string key
*
* @return void
* @since 3.2.0
*/
public function remove(string $key)
{
unset($this->active[$this->key($key)]);
}
/**
* Model the key
*
* @param string $key The key to model
*
* @return string
* @since 3.2.0
*/
abstract protected function key(string $key): string;
/**
* The Dynamic Content
*
* @var array
* @since 3.2.0
**/
public array $_active = [];
/**
* Set dynamic content
*
* @param string $firstKey The first key
* @param string $secondKey The second key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function set_(string $firstKey, string $secondKey, $value)
{
$this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)] = $value;
}
/**
* Get dynamic content
*
* @param string $firstKey The first key
* @param string|null $secondKey The second key
*
* @return mixed
* @since 3.2.0
*/
public function get_(string $firstKey, ?string $secondKey = null)
{
if (is_string($secondKey))
{
return $this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)] ?? null;
}
return $this->_active[$this->firstKey($firstKey)] ?? null;
}
/**
* Does keys exist
*
* @param string $firstKey The first key
* @param string|null $secondKey The second key
*
* @return bool
* @since 3.2.0
*/
public function exist_(string $firstKey, ?string $secondKey = null): bool
{
if (is_string($secondKey) && isset($this->_active[$this->firstKey($firstKey)]) &&
isset($this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)]))
{
return true;
}
elseif (is_null($secondKey) && isset($this->_active[$this->firstKey($firstKey)]))
{
return true;
}
return false;
}
/**
* Add dynamic content
*
* @param string $firstKey The first key
* @param string $secondKey The second key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function add_(string $firstKey, string $secondKey, $value)
{
if (isset($this->_active[$this->firstKey($firstKey)]) &&
isset($this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)]))
{
$this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)] .= $value;
}
else
{
$this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)] = $value;
}
}
/**
* Remove dynamic content
*
* @param string $firstKey The first key
* @param string|null $secondKey The second key
*
* @return void
* @since 3.2.0
*/
public function remove_(string $firstKey, ?string $secondKey = null)
{
if (is_string($secondKey))
{
unset($this->_active[$this->firstKey($firstKey)]
[$this->secondKey($secondKey)]);
}
else
{
unset($this->_active[$this->firstKey($firstKey)]);
}
}
/**
* Model the first key
*
* @param string $key The first key to model
*
* @return string
* @since 3.2.0
*/
abstract protected function firstKey(string $key): string;
/**
* Model the second key
*
* @param string $key The second key to model
*
* @return string
* @since 3.2.0
*/
abstract protected function secondKey(string $key): string;
}

View File

@ -0,0 +1,122 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Abstraction;
use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface;
/**
* Compiler Mapper Single
*
* @since 3.2.0
*/
abstract class MapperSingle implements Mappersingleinterface
{
/**
* The Content
*
* @var array
* @since 3.2.0
**/
public array $active = [];
/**
* Set content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function set(string $key, $value)
{
$this->active[$this->key($key)] = $value;
}
/**
* Get content
*
* @param string $key The main string key
*
* @return mixed
* @since 3.2.0
*/
public function get(string $key)
{
return $this->active[$this->key($key)] ?? null;
}
/**
* Does key exist
*
* @param string $key The main string key
*
* @return bool
* @since 3.2.0
*/
public function exist(string $key): bool
{
if (isset($this->active[$this->key($key)]))
{
return true;
}
return false;
}
/**
* Add content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function add(string $key, $value)
{
if (isset($this->active[$this->key($key)]))
{
$this->active[$this->key($key)] .= $value;
}
else
{
$this->active[$this->key($key)] = $value;
}
}
/**
* Remove content
*
* @param string $key The main string key
*
* @return void
* @since 3.2.0
*/
public function remove(string $key)
{
unset($this->active[$this->key($key)]);
}
/**
* Model the key
*
* @param string $key The key to model
*
* @return string
* @since 3.2.0
*/
abstract protected function key(string $key): string;
}

View File

@ -2,25 +2,23 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Search\Abstraction;
namespace VDM\Joomla\Componentbuilder\Abstraction;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Search\Table;
use VDM\Joomla\Componentbuilder\Table;
/**
* Search Model
* Our base Model
*
* @since 3.2.0
*/
@ -34,14 +32,6 @@ abstract class Model
*/
protected array $last;
/**
* Search Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Search Table
*
@ -53,17 +43,28 @@ abstract class Model
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param Table|null $table The search table object.
* @param Table $table The search table object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Table $table = null)
public function __construct(Table $table)
{
$this->config = $config ?: Factory::_('Config');
$this->table = $table ?: Factory::_('Table');
$this->table = $table;
}
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
abstract public function value($value, string $field, ?string $table = null);
/**
* Model the values of an item
* Example: $this->item('table_name', Object);
@ -79,14 +80,14 @@ abstract class Model
// set the table name
if (empty($table))
{
$table = $this->config->table_name;
$table = $this->getTable();
}
// field counter
$field_number = 0;
// check if this is a valid table
if (($fields = $this->table->fields($table)) !== null)
if (($fields = $this->getTableFields($table)) !== null)
{
foreach ($fields as $field)
{
@ -95,14 +96,13 @@ abstract class Model
{
$item->{$field} = $this->value($item->{$field}, $field, $table);
// remove empty values
if (!StringHelper::check($item->{$field}) && !ArrayHelper::check($item->{$field}, true))
if ($this->validate($item->{$field}))
{
unset($item->{$field});
$field_number++;
}
else
{
$field_number++;
unset($item->{$field});
}
}
}
@ -135,7 +135,7 @@ abstract class Model
// set the table name
if (empty($table))
{
$table = $this->config->table_name;
$table = $this->getTable();
}
foreach ($items as $id => &$item)
@ -175,7 +175,7 @@ abstract class Model
// set the table name
if (empty($table))
{
$table = $this->config->table_name;
$table = $this->getTable();
}
// check if this is a valid table
@ -186,6 +186,48 @@ abstract class Model
return null;
}
/**
* Validate the values (basic, override in child class)
*
* @param mixed $value The field value
* @param string|null $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
protected function validate(&$value, ?string $field = null, ?string $table = null): bool
{
// check values
if (StringHelper::check($value) || ArrayHelper::check($value, true))
{
return true;
}
// remove empty values
return false;
}
/**
* Get the current active table's fields
*
* @param string $table The table
*
* @return array
* @since 3.2.0
*/
protected function getTableFields(string $table): ?array
{
return $this->table->fields($table);
}
/**
* Get the current active table
*
* @return string
* @since 3.2.0
*/
abstract protected function getTable(): string;
}

View File

@ -0,0 +1,545 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Adminview;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Fields;
use VDM\Joomla\Componentbuilder\Compiler\Model\Historyadminview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Permissions;
use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions;
use VDM\Joomla\Componentbuilder\Compiler\Model\Relations;
use VDM\Joomla\Componentbuilder\Compiler\Model\Linkedviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptadminview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Cssadminview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Phpadminview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customimportscripts;
use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxadmin;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customalias;
use VDM\Joomla\Componentbuilder\Compiler\Model\Sql;
use VDM\Joomla\Componentbuilder\Compiler\Model\Mysqlsettings;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Admin View Data Class
*
* @since 3.2.0
*/
class Data
{
/**
* Admin views
*
* @var array
* @since 3.2.0
*/
protected array $data;
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Event
*
* @var EventInterface
* @since 3.2.0
*/
protected EventInterface $event;
/**
* Compiler Placeholder
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* Compiler Customcode Dispenser
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* The modelling customtabs
*
* @var Customtabs
* @since 3.2.0
*/
protected Customtabs $customtabs;
/**
* The modelling tabs
*
* @var Tabs
* @since 3.2.0
*/
protected Tabs $tabs;
/**
* The modelling fields
*
* @var Fields
* @since 3.2.0
*/
protected Fields $fields;
/**
* The modelling admin view history
*
* @var Historyadminview
* @since 3.2.0
*/
protected Historyadminview $history;
/**
* The modelling permissions
*
* @var Permissions
* @since 3.2.0
*/
protected Permissions $permissions;
/**
* The modelling conditions
*
* @var Conditions
* @since 3.2.0
*/
protected Conditions $conditions;
/**
* The modelling relations
*
* @var Relations
* @since 3.2.0
*/
protected Relations $relations;
/**
* The modelling linked views
*
* @var Linkedviews
* @since 3.2.0
*/
protected Linkedviews $linkedviews;
/**
* The modelling javascript
*
* @var Javascriptadminview
* @since 3.2.0
*/
protected Javascriptadminview $javascript;
/**
* The modelling css
*
* @var Cssadminview
* @since 3.2.0
*/
protected Cssadminview $css;
/**
* The modelling php admin view
*
* @var Phpadminview
* @since 3.2.0
*/
protected Phpadminview $php;
/**
* The modelling custom buttons
*
* @var Custombuttons
* @since 3.2.0
*/
protected Custombuttons $custombuttons;
/**
* The modelling custom import scripts
*
* @var Customimportscripts
* @since 3.2.0
*/
protected Customimportscripts $customimportscripts;
/**
* The modelling ajax
*
* @var Ajaxadmin
* @since 3.2.0
*/
protected Ajaxadmin $ajax;
/**
* The modelling custom alias
*
* @var Customalias
* @since 3.2.0
*/
protected Customalias $customalias;
/**
* The modelling sql
*
* @var Sql
* @since 3.2.0
*/
protected Sql $sql;
/**
* The modelling mysql settings
*
* @var Mysqlsettings
* @since 3.2.0
*/
protected Mysqlsettings $mysqlsettings;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param EventInterface|null $event The compiler event api object.
* @param Placeholder|null $placeholder The compiler placeholder object.
* @param Dispenser|null $dispenser The compiler customcode dispenser object.
* @param Customtabs|null $customtabs The modelling customtabs object.
* @param Tabs|null $tabs The modelling tabs object.
* @param Fields|null $fields The modelling fields object.
* @param Historyadminview|null $history The modelling admin view history object.
* @param Permissions|null $permissions The modelling permissions object.
* @param Conditions|null $conditions The modelling conditions object.
* @param Relations|null $relations The modelling relations object.
* @param Linkedviews|null $linkedviews The modelling linked views object.
* @param Javascriptadminview|null $javascript The modelling javascript object.
* @param Cssadminview|null $css The modelling css object.
* @param Phpadminview|null $php The modelling php admin view object.
* @param Custombuttons|null $custombuttons The modelling custom buttons object.
* @param Customimportscripts|null $customimportscripts The modelling custom import scripts object.
* @param Ajaxadmin|null $ajax The modelling ajax object.
* @param Customalias|null $customalias The modelling custom alias object.
* @param Sql|null $sql The modelling sql object.
* @param Mysqlsettings|null $mysqlsettings The modelling mysql settings object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?EventInterface $event = null, ?Placeholder $placeholder = null, ?Dispenser $dispenser = null,
?Customtabs $customtabs = null, ?Tabs $tabs = null, ?Fields $fields = null,
?Historyadminview $history = null, ?Permissions $permissions = null,
?Conditions $conditions = null, Relations $relations = null, ?Linkedviews $linkedviews = null,
?Javascriptadminview $javascript = null, ?Cssadminview $css = null, ?Phpadminview $php = null,
?Custombuttons $custombuttons = null, ?Customimportscripts $customimportscripts = null,
?Ajaxadmin $ajax = null, ?Customalias $customalias = null, ?Sql $sql = null,
?Mysqlsettings $mysqlsettings = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->event = $event ?: Compiler::_('Event');
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
$this->customtabs = $customtabs ?: Compiler::_('Model.Customtabs');
$this->tabs = $tabs ?: Compiler::_('Model.Tabs');
$this->fields = $fields ?: Compiler::_('Model.Fields');
$this->history = $history ?: Compiler::_('Model.Historyadminview');
$this->permissions = $permissions ?: Compiler::_('Model.Permissions');
$this->conditions = $conditions ?: Compiler::_('Model.Conditions');
$this->relations = $relations ?: Compiler::_('Model.Relations');
$this->linkedviews = $linkedviews ?: Compiler::_('Model.Linkedviews');
$this->javascript = $javascript ?: Compiler::_('Model.Javascriptadminview');
$this->css = $css ?: Compiler::_('Model.Cssadminview');
$this->php = $php ?: Compiler::_('Model.Phpadminview');
$this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons');
$this->customimportscripts = $customimportscripts ?: Compiler::_('Model.Customimportscripts');
$this->ajax = $ajax ?: Compiler::_('Model.Ajaxadmin');
$this->customalias = $customalias ?: Compiler::_('Model.Customalias');
$this->sql = $sql ?: Compiler::_('Model.Sql');
$this->mysqlsettings = $mysqlsettings ?: Compiler::_('Model.Mysqlsettings');
$this->db = $db ?: Factory::getDbo();
}
/**
* Get Admin View Data
*
* @param int $id The view ID
*
* @return object|null The view data
* @since 3.2.0
*/
public function get(int $id): ?object
{
if (!isset($this->data[$id]))
{
// Create a new query object.
$query = $this->db->getQuery(true);
$query->select('a.*');
$query->select(
$this->db->quoteName(
array(
'b.addfields',
'b.id',
'c.addconditions',
'c.id',
'r.addrelations',
't.tabs'
), array(
'addfields',
'addfields_id',
'addconditions',
'addconditions_id',
'addrelations',
'customtabs'
)
)
);
$query->from('#__componentbuilder_admin_view AS a');
$query->join(
'LEFT',
$this->db->quoteName('#__componentbuilder_admin_fields', 'b')
. ' ON (' . $this->db->quoteName('a.id') . ' = '
. $this->db->quoteName('b.admin_view') . ')'
);
$query->join(
'LEFT', $this->db->quoteName(
'#__componentbuilder_admin_fields_conditions', 'c'
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
. $this->db->quoteName('c.admin_view') . ')'
);
$query->join(
'LEFT', $this->db->quoteName(
'#__componentbuilder_admin_fields_relations', 'r'
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
. $this->db->quoteName('r.admin_view') . ')'
);
$query->join(
'LEFT', $this->db->quoteName(
'#__componentbuilder_admin_custom_tabs', 't'
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
. $this->db->quoteName('t.admin_view') . ')'
);
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// for plugin event TODO change event api signatures
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onBeforeQueryViewData
$this->event->trigger(
'jcb_ce_onBeforeQueryViewData',
array(&$component_context, &$id, &$query, &$this->db)
);
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$view = $this->db->loadObject();
// setup single view code names to use in storing the data
$view->name_single_code = 'oops_hmm_' . $id;
if (isset($view->name_single) && $view->name_single != 'null')
{
$view->name_single_code = StringHelper::safe(
$view->name_single
);
}
// setup list view code name to use in storing the data
$view->name_list_code = 'oops_hmmm_' . $id;
if (isset($view->name_list) && $view->name_list != 'null')
{
$view->name_list_code = StringHelper::safe(
$view->name_list
);
}
// check the length of the view name (+5 for com_ and _)
$name_length = $this->config->component_code_name_length + strlen(
(string) $view->name_single_code
) + 5;
// when the name is larger than 49 we need to add the assets' table name fix
if ($name_length > 49)
{
$this->config->set('add_assets_table_name_fix', true);
}
// setup token check
if (!isset($this->dispenser->hub['token']))
{
$this->dispenser->hub['token'] = [];
}
$this->dispenser->hub['token'][$view->name_single_code] = false;
$this->dispenser->hub['token'][$view->name_list_code] = false;
// set some placeholders
$this->placeholder->set('view', $view->name_single_code);
$this->placeholder->set('views', $view->name_list_code);
$this->placeholder->set('View', StringHelper::safe(
$view->name_single, 'F'
));
$this->placeholder->set('Views', StringHelper::safe(
$view->name_list, 'F'
));
$this->placeholder->set('VIEW', StringHelper::safe(
$view->name_single, 'U'
));
$this->placeholder->set('VIEWS', StringHelper::safe(
$view->name_list, 'U'
));
// for plugin event TODO change event api signatures
$placeholders = $this->placeholder->active;
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onBeforeModelViewData
$this->event->trigger(
'jcb_ce_onBeforeModelViewData',
array(&$component_context, &$view, &$placeholders)
);
unset($placeholders);
// add the tables
$view->addtables = (isset($view->addtables)
&& JsonHelper::check($view->addtables))
? json_decode((string) $view->addtables, true) : null;
if (ArrayHelper::check($view->addtables))
{
$view->tables = array_values($view->addtables);
}
unset($view->addtables);
// set custom tabs
$this->customtabs->set($view);
// set the local tabs
$this->tabs->set($view);
// set permissions
$this->permissions->set($view);
// set fields
$this->fields->set($view);
// build update SQL
$this->history->set($view);
// set the conditions
$this->conditions->set($view);
// set the relations
$this->relations->set($view);
// set linked views
$this->linkedviews->set($view);
// set the lang target
$this->config->lang_target = 'admin';
if ($this->registry->get('builder.site_edit_view.' . $id, false))
{
$this->config->lang_target = 'both';
}
// set javascript
$this->javascript->set($view);
// set css
$this->css->set($view);
// set php
$this->php->set($view);
// set custom buttons
$this->custombuttons->set($view);
// set custom import scripts
$this->customimportscripts->set($view);
// set Ajax for this view
$this->ajax->set($view);
// activate alias builder
$this->customalias->set($view);
// set sql
$this->sql->set($view);
// set mySql Table Settings
$this->mysqlsettings->set($view);
// for plugin event TODO change event api signatures
$placeholders = $this->placeholder->active;
// Trigger Event: jcb_ce_onAfterModelViewData
$this->event->trigger(
'jcb_ce_onAfterModelViewData',
array(&$component_context, &$view, &$placeholders)
);
// clear placeholders
$this->placeholder->remove('view');
$this->placeholder->remove('views');
$this->placeholder->remove('View');
$this->placeholder->remove('Views');
$this->placeholder->remove('VIEW');
$this->placeholder->remove('VIEWS');
// store this view to class object
$this->data[$id] = $view;
}
// return the found view data
return $this->data[$id];
}
}

View File

@ -0,0 +1,265 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Alias;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Model\Loader;
use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Alias Data Class
*
* @since 3.2.0
*/
class Data
{
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Customcode
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode in Gui
*
* @var Gui
* @since 3.2.0
**/
protected Gui $gui;
/**
* Compiler Auto Loader
*
* @var Loader
* @since 3.2.0
*/
protected Loader $loader;
/**
* Compiler Libraries Model
*
* @var Libraries
* @since 3.2.0
*/
protected Libraries $libraries;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Gui|null $gui The compiler customcode gui.
* @param Loader|null $load The compiler loader object.
* @param Libraries|null $libraries The compiler libraries model object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?Customcode $customcode = null, ?Gui $gui = null,
?Loader $loader = null, ?Libraries $libraries = null,
?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->loader = $loader ?: Compiler::_('Model.Loader');
$this->libraries = $libraries ?: Compiler::_('Model.Libraries');
$this->db = $db ?: Factory::getDbo();
}
/**
* Get Data by Alias
*
* @param string $alias The alias name
* @param string $table The table where to find the alias
* @param string $view The view code name
*
* @return array|null The data found with the alias
* @since 3.2.0
*/
public function get(string $alias, string $table, string $view): ?array
{
// if not set, get all keys in table and set by ID
$this->set($table);
// now check if key is found
$name = preg_replace("/[^A-Za-z]/", '', $alias);
if (($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $name, null)) === null &&
($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $alias, null)) === null)
{
return null;
}
// Create a new query object.
$query = $this->db->getQuery(true);
$query->select('a.*');
$query->from('#__componentbuilder_' . $table . ' AS a');
$query->where(
$this->db->quoteName('a.id') . ' = ' . (int) $id
);
// get the row
$this->db->setQuery($query);
$item = $this->db->loadObject();
// get the other target if both
$targets = [$this->config->build_target];
if ($this->config->lang_target === 'both')
{
$targets = ['site', 'admin'];
}
// we load this layout
$php_view = '';
if ($item->add_php_view == 1
&& StringHelper::check($item->php_view))
{
$php_view = $this->gui->set(
$this->customcode->update(base64_decode((string) $item->php_view)),
array(
'table' => $table,
'field' => 'php_view',
'id' => (int) $item->id,
'type' => 'php')
);
}
$content = $this->gui->set(
$this->customcode->update(base64_decode((string) $item->{$table})),
array(
'table' => $table,
'field' => $table,
'id' => (int) $item->id,
'type' => 'html')
);
// load all targets
foreach ($targets as $target)
{
// set libraries
$this->libraries->set($view, $item, $target);
// auto loaders
$this->loader->set($view, $content, $target);
$this->loader->set($view, $php_view, $target);
}
// load uikit version 2 if required
$this->loader->uikit($view, $content);
$this->loader->uikit($view, $php_view);
return [
'id' => $item->id,
'html' => $this->gui->set(
$content,
[
'table' => $table,
'field' => $table,
'id' => $item->id,
'type' => 'html'
]
),
'php_view' => $this->gui->set(
$php_view,
[
'table' => $table,
'field' => 'php_view',
'id' => $item->id,
'type' => 'php'
]
)
];
}
/**
* Load all alias and ID's of a table
*
* @param string $table The table where to find the alias
*
* @return void
* @since 3.2.0
*/
protected function set(string $table)
{
// now check if key is found
if (!$this->registry->get('builder.data_with_alias_keys.' . $table, null))
{
// Create a new query object.
$query = $this->db->getQuery(true);
$query->select(array('a.id', 'a.alias'));
$query->from('#__componentbuilder_' . $table . ' AS a');
$this->db->setQuery($query);
$items = $this->db->loadObjectList();
// check if we have an array
if (ArrayHelper::check($items))
{
foreach ($items as $item)
{
// build the key
$k_ey = StringHelper::safe($item->alias);
$key = preg_replace("/[^A-Za-z]/", '', (string) $k_ey);
// set the keys
$this->registry->
set('builder.data_with_alias_keys.' . $table . '.' . $item->alias, $item->id);
$this->registry->
set('builder.data_with_alias_keys.' . $table . '.' . $k_ey, $item->id);
$this->registry->
set('builder.data_with_alias_keys.' . $table . '.' . $key, $item->id);
}
}
}
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Component\Data;
use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry;
/**
* Compiler Component
*
* @since 3.2.0
*/
class Component extends BaseRegistry
{
/**
* Constructor
*
* @param Data|null $component The component data class.
*
* @since 3.2.0
*/
public function __construct(?Data $component = null)
{
$component = $component ?: Compiler::_('Component.Data');
parent::__construct($component->get());
}
/**
* getting any valid value
*
* @param string $path The value's key/path name
*
* @since 3.2.0
*/
public function __get(string $path)
{
// check if it has been set
if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
{
return $value;
}
return null;
}
}

View File

@ -0,0 +1,213 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Application\CMSApplication;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Compiler Component Dynamic Dashboard
*
* @since 3.2.0
*/
class Dashboard
{
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Component
*
* @var Component
* @since 3.2.0
**/
protected Component $component;
/**
* Application object.
*
* @var CMSApplication
* @since 3.2.0
**/
protected CMSApplication $app;
/**
* Constructor
*
* @param Registry|null $registry The compiler registry object.
* @param Component|null $component The component class.
* @param CMSApplication|null $app The app object.
*
* @since 3.2.0
*/
public function __construct(?Registry $registry = null, ?Component $component = null,
?CMSApplication $app = null)
{
$this->registry = $registry ?: Compiler::_('Registry');
$this->component = $component ?: Compiler::_('Component');
$this->app = $app ?: Factory::getApplication();
}
/**
* Set the Dynamic Dashboard
*
* @return void
* @since 3.2.0
*/
public function set()
{
// only add the dynamic dashboard if all checks out
if ($this->component->get('dashboard_type', 0) == 2
&& ($dashboard_ = $this->component->get('dashboard')) !== null
&& StringHelper::check($dashboard_)
&& strpos((string) $dashboard_, '_') !== false)
{
// set the default view
$getter = explode('_', (string) $dashboard_);
if (count((array) $getter) == 2 && is_numeric($getter[1]))
{
// the pointers
$t = StringHelper::safe($getter[0], 'U');
$id = (int) $getter[1];
// the dynamic stuff
$targets = array('A' => 'admin_views',
'C' => 'custom_admin_views');
$names = array('A' => 'admin view',
'C' => 'custom admin view');
$types = array('A' => 'adminview', 'C' => 'customadminview');
$keys = array('A' => 'name_list', 'C' => 'code');
// check the target values
if (isset($targets[$t]) && $id > 0)
{
// set the type name
$type_names = StringHelper::safe(
$targets[$t], 'w'
);
// set the dynamic dash
if (($target_ = $this->component->get($targets[$t])) !== null
&& ArrayHelper::check($target_))
{
// search the target views
$dashboard = (array) array_filter(
$target_,
function ($view) use ($id, $t, $types) {
if (isset($view[$types[$t]])
&& $id == $view[$types[$t]])
{
return true;
}
return false;
}
);
// set dashboard
if (ArrayHelper::check($dashboard))
{
$dashboard = array_values($dashboard)[0];
}
// check if view was found (this should be true)
if (isset($dashboard['settings'])
&& isset($dashboard['settings']->{$keys[$t]}))
{
$this->registry->set('build.dashboard',
StringHelper::safe(
$dashboard['settings']->{$keys[$t]}
)
);
$this->registry->set('build.dashboard.type',
$targets[$t]
);
}
else
{
// set massage that something is wrong
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'),
'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT',
$names[$t], $dashboard_,
$type_names
), 'Error'
);
}
}
else
{
// set massage that something is wrong
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT',
$names[$t], $dashboard_,
$type_names
), 'Error'
);
}
}
else
{
// the target value is wrong
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID',
$dashboard_
), 'Error'
);
}
}
else
{
// the target value is wrong
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID',
$dashboard_
), 'Error'
);
}
// if default was changed to dynamic dashboard the remove default tab and methods
if ($this->registry->get('build.dashboard'))
{
// dynamic dashboard is used
$this->component->remove('dashboard_tab');
$this->component->remove('php_dashboard_methods');
}
}
}
}

View File

@ -0,0 +1,866 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Field as Field;
use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName;
use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName;
use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders;
use VDM\Joomla\Componentbuilder\Compiler\Model\Historycomponent;
use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking;
use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Siteviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customadminviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules;
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Compiler Component Data
*
* @since 3.2.0
*/
class Data
{
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Compiler Event
*
* @var EventInterface
* @since 3.2.0
*/
protected EventInterface $event;
/**
* Compiler Placeholder
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* Compiler Component Placeholder
*
* @var ComponentPlaceholder
* @since 3.2.0
**/
protected ComponentPlaceholder $componentPlaceholder;
/**
* Compiler Customcode Dispenser
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* Compiler Customcode
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode in Gui
*
* @var Gui
* @since 3.2.0
**/
protected Gui $gui;
/**
* Compiler Field
*
* @var Field
* @since 3.2.0
*/
protected Field $field;
/**
* Compiler field name
*
* @var FieldName
* @since 3.2.0
*/
protected FieldName $fieldName;
/**
* Compiler Field Unique Name
*
* @var UniqueName
* @since 3.2.0
**/
protected UniqueName $uniqueName;
/**
* Compiler Files Folders
*
* @var Filesfolders
* @since 3.2.0
*/
protected Filesfolders $filesFolders;
/**
* The modelling component history
*
* @var Historycomponent
* @since 3.2.0
*/
protected Historycomponent $history;
/**
* The modelling whmcs
*
* @var Whmcs
* @since 3.2.0
*/
protected Whmcs $whmcs;
/**
* The modelling Sql Tweaking
*
* @var Sqltweaking
* @since 3.2.0
*/
protected Sqltweaking $sqltweaking;
/**
* The modelling Admin Views
*
* @var Adminviews
* @since 3.2.0
*/
protected Adminviews $adminviews;
/**
* The modelling Site Views
*
* @var Siteviews
* @since 3.2.0
*/
protected Siteviews $siteviews;
/**
* The modelling Custom Admin Views
*
* @var Customadminviews
* @since 3.2.0
*/
protected Customadminviews $customadminviews;
/**
* The modelling Joomla Modules
*
* @var Joomlamodules
* @since 3.2.0
*/
protected Joomlamodules $modules;
/**
* The modelling Joomla Plugins
*
* @var Joomlaplugins
* @since 3.2.0
*/
protected Joomlaplugins $plugins;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param EventInterface|null $event The compiler event api object.
* @param Placeholder|null $placeholder The compiler placeholder object.
* @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object.
* @param Dispenser|null $dispenser The compiler customcode dispenser object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Gui|null $gui The compiler customcode gui.
* @param Field|null $field The compiler field object.
* @param FieldName|null $fieldName The compiler field name object.
* @param UniqueName|null $uniqueName The compiler field unique name object.
* @param Filesfolders|null $filesFolders The compiler files folders object.
* @param Historycomponent|null $history The modelling component history object.
* @param Whmcs|null $whmcs The modelling whmcs object.
* @param Sqltweaking|null $sqltweaking The modelling sql tweaking object.
* @param Adminviews|null $adminviews The modelling adminviews object.
* @param Siteviews|null $siteviews The modelling siteviews object.
* @param Customadminviews|null $customadminviews The modelling customadminviews object.
* @param Joomlamodules|null $modules The modelling modules object.
* @param Joomlaplugins|null $plugins The modelling plugins object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?EventInterface $event = null,
?Placeholder $placeholder = null, ?ComponentPlaceholder $componentPlaceholder = null,
?Dispenser $dispenser = null, ?Customcode $customcode = null, ?Gui $gui = null,
?Field $field = null, ?FieldName $fieldName = null, ?UniqueName $uniqueName = null,
?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null,
?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null,
?Customadminviews $customadminviews = null, ?Joomlamodules $modules = null,
?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->event = $event ?: Compiler::_('Event');
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
$this->componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder');
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->field = $field ?: Compiler::_('Field');
$this->fieldName = $fieldName ?: Compiler::_('Field.Name');
$this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name');
$this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders');
$this->history = $history ?: Compiler::_('Model.Historycomponent');
$this->whmcs = $whmcs ?: Compiler::_('Model.Whmcs');
$this->sqltweaking = $sqltweaking ?: Compiler::_('Model.Sqltweaking');
$this->adminviews = $adminviews ?: Compiler::_('Model.Adminviews');
$this->siteviews = $siteviews ?: Compiler::_('Model.Siteviews');
$this->customadminviews = $customadminviews ?: Compiler::_('Model.Customadminviews');
$this->modules = $modules ?: Compiler::_('Model.Joomlamodules');
$this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins');
$this->db = $db ?: Factory::getDbo();
}
/**
* get current component data
*
* @return object|null The component data
* @since 3.2.0
*/
public function get(): ?object
{
// Create a new query object.
$query = $this->db->getQuery(true);
// selection
$selection = array(
'b.addadmin_views' => 'addadmin_views',
'b.id' => 'addadmin_views_id',
'h.addconfig' => 'addconfig',
'd.addcustom_admin_views' => 'addcustom_admin_views',
'g.addcustommenus' => 'addcustommenus',
'j.addfiles' => 'addfiles',
'j.addfolders' => 'addfolders',
'j.addfilesfullpath' => 'addfilesfullpath',
'j.addfoldersfullpath' => 'addfoldersfullpath',
'c.addsite_views' => 'addsite_views',
'l.addjoomla_plugins' => 'addjoomla_plugins',
'k.addjoomla_modules' => 'addjoomla_modules',
'i.dashboard_tab' => 'dashboard_tab',
'i.php_dashboard_methods' => 'php_dashboard_methods',
'i.params' => 'dashboard_params',
'i.id' => 'component_dashboard_id',
'f.sql_tweak' => 'sql_tweak',
'e.version_update' => 'version_update',
'e.id' => 'version_update_id'
);
$query->select('a.*');
$query->select(
$this->db->quoteName(
array_keys($selection), array_values($selection)
)
);
// from this table
$query->from('#__componentbuilder_joomla_component AS a');
// jointer-map
$joiners = array(
'b' => 'component_admin_views',
'c' => 'component_site_views',
'd' => 'component_custom_admin_views',
'e' => 'component_updates',
'f' => 'component_mysql_tweaks',
'g' => 'component_custom_admin_menus',
'h' => 'component_config',
'i' => 'component_dashboard',
'j' => 'component_files_folders',
'l' => 'component_plugins',
'k' => 'component_modules'
);
// load the joins
foreach ($joiners as $as => $join)
{
$query->join(
'LEFT',
$this->db->quoteName('#__componentbuilder_' . $join, $as)
. ' ON (' . $this->db->quoteName('a.id') . ' = '
. $this->db->quoteName($as . '.joomla_component') . ')'
);
}
$query->where(
$this->db->quoteName('a.id') . ' = ' . (int) $this->config->component_id
);
// for plugin event TODO change event api signatures
$component_context = $this->config->component_context;
$component_id = $this->config->component_id;
// Trigger Event: jcb_ce_onBeforeQueryComponentData
$this->event->trigger(
'jcb_ce_onBeforeQueryComponentData',
array(&$component_context, &$component_id, &$query,
&$this->db)
);
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
// Load the results as a list of stdClass objects
$component = $this->db->loadObject();
// make sure we got a component loaded
if (!is_object($component) || !isset($component->system_name))
{
return null;
}
// Trigger Event: jcb_ce_onBeforeModelComponentData
$this->event->trigger(
'jcb_ce_onBeforeModelComponentData',
array(&$component_context, &$component)
);
// load the global placeholders
$this->placeholder->active = $this->componentPlaceholder->get();
// set component sales name
$component->sales_name = StringHelper::safe(
$component->system_name
);
// set the component name_code
$component->name_code = StringHelper::safe(
$component->name_code
);
// ensure version naming is correct
$this->config->set('component_version', preg_replace(
'/[^0-9.]+/', '', (string) $component->component_version
)
);
// set the website and autor for global use (default to VDM if not found)
$this->config->set('project_website', $component->website ?? 'https://dev.vdm.io');
$this->config->set('project_author', $component->author ?? 'VDM');
// set the files and folders
$this->filesFolders->set($component);
// set the uikit switch
$this->config->set('uikit', $component->adduikit);
// set whmcs links if needed
$this->whmcs->set($component);
// set the footable switch
if ($component->addfootable)
{
// force add footable
$this->config->set('footable ', true);
// add the version
$this->config->set('footable_version', (3 == $component->addfootable) ? 3 : 2);
}
// set the addcustommenus data
$component->addcustommenus = (isset($component->addcustommenus)
&& JsonHelper::check($component->addcustommenus))
? json_decode((string) $component->addcustommenus, true) : null;
if (ArrayHelper::check($component->addcustommenus))
{
$component->custommenus = array_values($component->addcustommenus);
}
unset($component->addcustommenus);
// set the sql tweak data
$this->sqltweaking->set($component);
// set the admin view data
$this->adminviews->set($component);
// set the site view data
$this->siteviews->set($component);
// set the custom_admin_views data
$this->customadminviews->set($component);
// set the config data
$component->addconfig = (isset($component->addconfig)
&& JsonHelper::check($component->addconfig))
? json_decode((string) $component->addconfig, true) : null;
if (ArrayHelper::check($component->addconfig))
{
$component->config = array_map(
function ($field) {
// make sure the alias and title is 0
$field['alias'] = 0;
$field['title'] = 0;
// set the field details
$this->field->set($field);
// set unique name counter
$this->uniqueName->set($field['base_name'], 'configs');
// return field
return $field;
}, array_values($component->addconfig)
);
// do some house cleaning (for fields)
foreach ($component->config as $field)
{
// so first we lock the field name in
$this->fieldName->get($field, 'configs');
}
// unset original value
unset($component->addconfig);
}
// set the add contributors
$component->addcontributors = (isset($component->addcontributors)
&& JsonHelper::check($component->addcontributors))
? json_decode((string) $component->addcontributors, true) : null;
if (ArrayHelper::check($component->addcontributors))
{
$this->config->set('add_contributors', true);
$component->contributors = array_values(
$component->addcontributors
);
}
unset($component->addcontributors);
// set the version updates
$component->version_update = (isset($component->version_update)
&& JsonHelper::check($component->version_update))
? json_decode((string) $component->version_update, true) : null;
if (ArrayHelper::check($component->version_update))
{
$component->version_update = array_values(
$component->version_update
);
}
// build the build date
if ($this->config->get('add_build_date', 1) == 3)
{
if (empty($this->component->modified) ||
$this->component->modified == '0000-00-00' ||
$this->component->modified == '0000-00-00 00:00:00')
{
$this->config->set('build_date', $this->component->created);
}
else
{
$this->config->set('build_date', $this->component->modified);
}
}
// build update SQL
$this->history->set($component);
// set GUI mapper
$guiMapper = [
'table' => 'joomla_component',
'id' => (int) $this->config->component_id,
'field' => 'javascript',
'type' => 'js'
];
// add_javascript
if ($component->add_javascript == 1)
{
$this->dispenser->set(
$component->javascript,
'component_js',
null,
null,
$guiMapper
);
}
else
{
$this->dispenser->hub['component_js'] = '';
}
unset($component->javascript);
// add global CSS
$addGlobalCss = ['admin', 'site'];
foreach ($addGlobalCss as $area)
{
// add_css if found
if (isset($component->{'add_css_' . $area})
&& $component->{'add_css_' . $area} == 1
&& isset($component->{'css_' . $area})
&& StringHelper::check(
$component->{'css_' . $area}
))
{
$this->dispenser->set(
$component->{'css_' . $area},
'component_css_' . $area
);
}
else
{
$this->dispenser->hub['component_css_' . $area] = '';
}
unset($component->{'css_' . $area});
}
// set the lang target
$this->config->lang_target = 'admin';
// add PHP in ADMIN
$addScriptMethods = [
'php_preflight',
'php_postflight',
'php_method'
];
$addScriptTypes = [
'install',
'update',
'uninstall'
];
// update GUI mapper
$guiMapper['type'] = 'php';
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
{
if (isset(
$component->{'add_' . $scriptMethod . '_' . $scriptType}
)
&& $component->{'add_' . $scriptMethod . '_' . $scriptType}
== 1
&& StringHelper::check(
$component->{$scriptMethod . '_' . $scriptType}
))
{
// set GUI mapper field
$guiMapper['field'] = $scriptMethod . '_' . $scriptType;
$this->dispenser->set(
$component->{$scriptMethod . '_' . $scriptType},
$scriptMethod,
$scriptType,
null,
$guiMapper
);
}
else
{
$this->dispenser->hub[$scriptMethod][$scriptType] = '';
}
unset($component->{$scriptMethod . '_' . $scriptType});
}
}
// add_php_helper
if ($component->add_php_helper_admin == 1
&& StringHelper::check(
$component->php_helper_admin
))
{
$this->config->lang_target = 'admin';
// update GUI mapper
$guiMapper['field'] = 'php_helper_admin';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
$this->dispenser->set(
$component->php_helper_admin,
'component_php_helper_admin',
null,
null,
$guiMapper
);
unset($guiMapper['prefix']);
}
else
{
$this->dispenser->hub['component_php_helper_admin'] = '';
}
unset($component->php_helper);
// add_admin_event
if ($component->add_admin_event == 1
&& StringHelper::check($component->php_admin_event))
{
$this->config->lang_target = 'admin';
// update GUI mapper field
$guiMapper['field'] = 'php_admin_event';
$this->dispenser->set(
$component->php_admin_event,
'component_php_admin_event',
null,
null,
$guiMapper
);
}
else
{
$this->dispenser->hub['component_php_admin_event'] = '';
}
unset($component->php_admin_event);
// add_php_helper_both
if ($component->add_php_helper_both == 1
&& StringHelper::check($component->php_helper_both))
{
$this->config->lang_target = 'both';
// update GUI mapper field
$guiMapper['field'] = 'php_helper_both';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
$this->dispenser->set(
$component->php_helper_both,
'component_php_helper_both',
null,
null,
$guiMapper
);
unset($guiMapper['prefix']);
}
else
{
$this->dispenser->hub['component_php_helper_both'] = '';
}
// add_php_helper_site
if ($component->add_php_helper_site == 1
&& StringHelper::check($component->php_helper_site))
{
$this->config->lang_target = 'site';
// update GUI mapper field
$guiMapper['field'] = 'php_helper_site';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
$this->dispenser->set(
$component->php_helper_site,
'component_php_helper_site',
null,
null,
$guiMapper
);
unset($guiMapper['prefix']);
}
else
{
$this->dispenser->hub['component_php_helper_site'] = '';
}
unset($component->php_helper);
// add_site_event
if ($component->add_site_event == 1
&& StringHelper::check($component->php_site_event))
{
$this->config->lang_target = 'site';
// update GUI mapper field
$guiMapper['field'] = 'php_site_event';
$this->dispenser->set(
$component->php_site_event,
'component_php_site_event',
null,
null,
$guiMapper
);
}
else
{
$this->dispenser->hub['component_php_site_event'] = '';
}
unset($component->php_site_event);
// add_sql
if ($component->add_sql == 1)
{
$this->dispenser->set(
$component->sql,
'sql',
'component_sql'
);
}
unset($component->sql);
// add_sql_uninstall
if ($component->add_sql_uninstall == 1)
{
$this->dispenser->set(
$component->sql_uninstall,
'sql_uninstall'
);
}
unset($component->sql_uninstall);
// bom
if (StringHelper::check($component->bom))
{
$this->config->set('bom_path',
$this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom
);
}
unset($component->bom);
// README
$component->readme =
$component->addreadme ?
$this->customcode->update(
base64_decode((string) $component->readme)
) : '';
// set lang now
$nowLang = $this->config->lang_target;
$this->config->lang_target = 'admin';
// dashboard methods
$component->dashboard_tab = (isset($component->dashboard_tab)
&& JsonHelper::check($component->dashboard_tab))
? json_decode((string) $component->dashboard_tab, true) : null;
if (ArrayHelper::check($component->dashboard_tab))
{
$component->dashboard_tab = array_map(
function ($array) {
$array['html'] = $this->customcode->update($array['html']);
return $array;
}, array_values($component->dashboard_tab)
);
}
else
{
$component->dashboard_tab = '';
}
// add the php of the dashboard if set
if (isset($component->php_dashboard_methods)
&& StringHelper::check(
$component->php_dashboard_methods
))
{
// load the php for the dashboard model
$component->php_dashboard_methods = $this->gui->set(
$this->customcode->update(
base64_decode((string) $component->php_dashboard_methods)
),
[
'table' => 'component_dashboard',
'field' => 'php_dashboard_methods',
'id' => (int) $component->component_dashboard_id,
'type' => 'php'
]
);
}
else
{
$component->php_dashboard_methods = '';
}
// reset back to now lang
$this->config->lang_target = $nowLang;
// add the update/sales server FTP details if that is the expected protocol
$serverArray = array('update_server', 'sales_server');
foreach ($serverArray as $server)
{
if ($component->{'add_' . $server} == 1
&& is_numeric(
$component->{$server}
)
&& $component->{$server} > 0)
{
// get the server protocol
$component->{$server . '_protocol'}
= GetHelper::var(
'server', (int) $component->{$server}, 'id', 'protocol'
);
}
else
{
$component->{$server} = 0;
// only change this for sales server (update server can be added loacaly to the zip file)
if ('sales_server' === $server)
{
$component->{'add_' . $server} = 0;
}
$component->{$server . '_protocol'} = 0;
}
}
// set the ignore folders for repo if found
if (isset($component->toignore)
&& StringHelper::check(
$component->toignore
))
{
if (strpos((string) $component->toignore, ',') !== false)
{
$component->toignore = array_map(
'trim', (array) explode(',', (string) $component->toignore)
);
}
else
{
$component->toignore = array(trim((string) $component->toignore));
}
}
else
{
// the default is to ignore the repo folder
$component->toignore = array('.git');
}
// set all modules
$this->modules->set($component);
// set all plugins
$this->plugins->set($component);
// Trigger Event: jcb_ce_onAfterModelComponentData
$this->event->trigger(
'jcb_ce_onAfterModelComponentData',
array(&$component_context, &$component)
);
// return found component data
return $component;
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -88,7 +88,7 @@ class Placeholder implements PlaceholderInterface
// load the db
$db = $this->db;
// reset bucket
$bucket = array();
$bucket = [];
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.target', 'a.value')));
@ -105,7 +105,7 @@ class Placeholder implements PlaceholderInterface
// open all the code
foreach ($bucket as $key => &$code)
{
$code = base64_decode($code);
$code = base64_decode((string) $code);
}
}
@ -126,7 +126,7 @@ class Placeholder implements PlaceholderInterface
)) !== false
&& JsonHelper::check($_placeholders))
{
$_placeholders = json_decode($_placeholders, true);
$_placeholders = json_decode((string) $_placeholders, true);
if (ArrayHelper::check($_placeholders))
{
foreach ($_placeholders as $row)

View File

@ -0,0 +1,756 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Compiler Component (Joomla Version) Settings
*
* @since 3.2.0
*/
class Settings
{
/**
* The standard folders
*
* @var array
* @since 3.2.0
*/
protected array $standardFolders = [
'site',
'admin',
'media'
];
/**
* The standard root files
*
* @var array
* @since 3.2.0
*/
protected array $standardRootFiles = [
'access.xml',
'config.xml',
'controller.php',
'index.html',
'README.txt'
];
/**
* Compiler Joomla Version Data
*
* @var object|null
* @since 3.2.0
*/
protected ?object $data = null;
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Event
*
* @var EventInterface
* @since 3.2.0
*/
protected EventInterface $event;
/**
* Compiler Placeholder
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* Compiler Component
*
* @var Component
* @since 3.2.0
**/
protected Component $component;
/**
* Compiler Utilities Paths
*
* @var Paths
* @since 3.2.0
*/
protected Paths $paths;
/**
* Compiler Component Dynamic Path
*
* @var Dynamicpath
* @since 3.2.0
**/
protected Dynamicpath $dynamicpath;
/**
* Compiler Component Pathfix
*
* @var Pathfix
* @since 3.2.0
**/
protected Pathfix $pathfix;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param EventInterface|null $event The compiler event api object.
* @param Placeholder|null $placeholder The compiler placeholder object.
* @param Component|null $component The component class.
* @param Paths|null $paths The compiler paths object.
* @param Dynamicpath|null $dynamicpath The compiler dynamic path object.
* @param Pathfix|null $pathfix The compiler path fixing object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?EventInterface $event = null, ?Placeholder $placeholder = null,
?Component $component = null, ?Paths $paths = null,
?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->event = $event ?: Compiler::_('Event');
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
$this->component = $component ?: Compiler::_('Component');
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
$this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath');
$this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix');
// add component endpoint file to stander list of root files
$this->standardRootFiles[] = $this->component->get('name_code') . '.php';
}
/**
* Check if data set is loaded
*
* @return bool
* @since 3.2.0
*/
public function exists(): bool
{
if (!$this->isSet())
{
// load the data
$this->data = $this->get();
if (!$this->isSet())
{
return false;
}
}
return true;
}
/**
* Get Joomla - Folder Structure to Create
*
* @return object The version related structure
* @since 3.2.0
*/
public function structure(): object
{
return $this->data->create;
}
/**
* Get Joomla - Move Multiple Structure
*
* @return object The version related multiple structure
* @since 3.2.0
*/
public function multiple(): object
{
return $this->data->move->dynamic;
}
/**
* Get Joomla - Move Single Structure
*
* @return object The version related single structure
* @since 3.2.0
*/
public function single(): object
{
return $this->data->move->static;
}
/**
* Check if Folder is a Standard Folder
*
* @param string $folder The folder name
*
* @return bool true if the folder exists
* @since 3.2.0
*/
public function standardFolder(string $folder): bool
{
return in_array($folder, $this->standardFolders);
}
/**
* Check if File is a Standard Root File
*
* @param string $file The file name
*
* @return bool true if the file exists
* @since 3.2.0
*/
public function standardRootFile(string $file): bool
{
return in_array($file, $this->standardRootFiles);
}
/**
* Check if Data is Set
*
* @return bool
* @since 3.2.0
*/
private function isSet(): bool
{
return is_object($this->data) &&
isset($this->data->create) &&
isset($this->data->move) &&
isset($this->data->move->static) &&
isset($this->data->move->dynamic);
}
/**
* get the Joomla Version Data
*
* @return object|null The version data
* @since 3.2.0
*/
private function get(): ?object
{
// override option
$customSettings = $this->paths->template_path . '/settings_' .
$this->config->component_code_name . '.json';
// get the data
$version_data = $this->readJsonFile($customSettings);
if (is_null($version_data) || !$this->isValidData($version_data))
{
return null;
}
$this->loadExtraFolders();
$this->loadExtraFiles();
$this->addFolders($version_data);
$this->addFiles($version_data);
// for plugin event TODO change event api signatures
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onAfterSetJoomlaVersionData
$this->event->trigger(
'jcb_ce_onAfterSetJoomlaVersionData',
array(&$component_context, &$version_data)
);
return $version_data;
}
/**
* Read the Json file data
*
* @param string $filePath
*
* @return object|null The version data
* @since 3.2.0
*/
private function readJsonFile(string $filePath): ?object
{
if (FileHelper::exists($filePath))
{
$jsonContent = FileHelper::getContent($filePath);
}
else
{
$jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json');
}
if (JsonHelper::check($jsonContent))
{
return json_decode((string) $jsonContent);
}
return null;
}
/**
* Check if this is valid data
*
* @param object $versionData
*
* @return bool
* @since 3.2.0
*/
private function isValidData(object $versionData): bool
{
return isset($versionData->create) &&
isset($versionData->move) &&
isset($versionData->move->static) &&
isset($versionData->move->dynamic);
}
/**
* Add Extra/Dynamic folders
*
* @return void
* @since 3.2.0
*/
private function loadExtraFolders()
{
if ($this->component->isArray('folders') ||
$this->config->get('add_eximport', false) ||
$this->config->get('uikit', 0) ||
$this->config->get('footable', false))
{
$this->addImportViewFolder();
$this->addPhpSpreadsheetFolder();
$this->addUikitFolder();
$this->addFooTableFolder();
}
}
/**
* Add Import and Export Folder
*
* @return void
* @since 3.2.0
*/
private function addImportViewFolder()
{
if ($this->config->get('add_eximport', false))
{
$this->component->appendArray('folders', [
'folder' => 'importViews',
'path' => 'admin/views/import',
'rename' => 1
]);
}
}
/**
* Add Php Spreadsheet Folder
*
* @return void
* @since 3.2.0
*/
private function addPhpSpreadsheetFolder()
{
// move the phpspreadsheet Folder (TODO we must move this to a library package)
if ($this->config->get('add_eximport', false))
{
$this->component->appendArray('folders', [
'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor',
'path' => '/libraries/phpspreadsheet/',
'rename' => 0
]);
}
}
/**
* Add Uikit Folders
*
* @return void
* @since 3.2.0
*/
private function addUikitFolder()
{
$uikit = $this->config->get('uikit', 0);
if (2 == $uikit || 1 == $uikit)
{
// move the UIKIT Folder into place
$this->component->appendArray('folders', [
'folder' => 'uikit-v2',
'path' => 'media',
'rename' => 0
]);
}
if (2 == $uikit || 3 == $uikit)
{
// move the UIKIT-3 Folder into place
$this->component->appendArray('folders', [
'folder' => 'uikit-v3',
'path' => 'media',
'rename' => 0
]);
}
}
/**
* Add Foo Table Folder
*
* @return void
* @since 3.2.0
*/
private function addFooTableFolder()
{
if (!$this->config->get('footable', false))
{
return;
}
$footable_version = $this->config->get('footable_version', 2);
if (2 == $footable_version)
{
// move the footable folder into place
$this->component->appendArray('folders', [
'folder' => 'footable-v2',
'path' => 'media',
'rename' => 0
]);
}
elseif (3 == $footable_version)
{
// move the footable folder into place
$this->component->appendArray('folders', [
'folder' => 'footable-v3',
'path' => 'media',
'rename' => 0
]);
}
}
/**
* Add Extra/Dynamic files
*
* @return void
* @since 3.2.0
*/
private function loadExtraFiles()
{
if ($this->component->isArray('files') ||
$this->config->get('google_chart', false))
{
$this->addGoogleChartFiles();
}
}
/**
* Add Google Chart Files
*
* @return void
* @since 3.2.0
*/
private function addGoogleChartFiles()
{
if ($this->config->get('google_chart', false))
{
// move the google chart files
$this->component->appendArray('files', [
'file' => 'google.jsapi.js',
'path' => 'media/js',
'rename' => 0
]);
$this->component->appendArray('files', [
'file' => 'chartbuilder.php',
'path' => 'admin/helpers',
'rename' => 0
]);
}
}
/**
* Add Folders
*
* @param object $versionData
*
* @return void
* @since 3.2.0
*/
private function addFolders(object &$versionData)
{
if (!$this->component->isArray('folders'))
{
return;
}
// pointer tracker
$pointer_tracker = 'h';
foreach ($this->component->get('folders') as $custom)
{
// check type of target type
$_target_type = 'c0mp0n3nt';
if (isset($custom['target_type']))
{
$_target_type = $custom['target_type'];
}
// for good practice
$this->pathfix->set(
$custom, ['path', 'folder', 'folderpath']
);
// fix custom path
if (isset($custom['path'])
&& StringHelper::check($custom['path']))
{
$custom['path'] = trim((string) $custom['path'], '/');
}
// by default custom path is true
$customPath = 'custom';
// set full path if this is a full path folder
if (!isset($custom['folder']) && isset($custom['folderpath']))
{
// update the dynamic path
$custom['folderpath'] = $this->dynamicpath->update(
$custom['folderpath']
);
// set the folder path with / if does not have a drive/windows full path
$custom['folder'] = (preg_match(
'/^[a-z]:/i', $custom['folderpath']
)) ? trim($custom['folderpath'], '/')
: '/' . trim($custom['folderpath'], '/');
// remove the file path
unset($custom['folderpath']);
// triget fullpath
$customPath = 'full';
}
// make sure we use the correct name
$pathArray = (array) explode('/', (string) $custom['path']);
$lastFolder = end($pathArray);
// only rename folder if last has folder name
if (isset($custom['rename']) && $custom['rename'] == 1)
{
$custom['path'] = str_replace(
'/' . $lastFolder, '', (string) $custom['path']
);
$rename = 'new';
$newname = $lastFolder;
}
elseif ('full' === $customPath)
{
// make sure we use the correct name
$folderArray = (array) explode('/', (string) $custom['folder']);
$lastFolder = end($folderArray);
$rename = 'new';
$newname = $lastFolder;
}
else
{
$rename = false;
$newname = '';
}
// insure we have no duplicates
$key_pointer = StringHelper::safe(
$custom['folder']
) . '_f' . $pointer_tracker;
$pointer_tracker++;
// fix custom path
$custom['path'] = ltrim((string) $custom['path'], '/');
// set new folder to object
$versionData->move->static->{$key_pointer} = new \stdClass();
$versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']);
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
$versionData->move->static->{$key_pointer}->rename = $rename;
$versionData->move->static->{$key_pointer}->newName = $newname;
$versionData->move->static->{$key_pointer}->type = 'folder';
$versionData->move->static->{$key_pointer}->custom = $customPath;
// set the target if type and id is found
if (isset($custom['target_id']) && isset($custom['target_type']))
{
$versionData->move->static->{$key_pointer}->_target = [
'key' => $custom['target_id'] . '_' . $custom['target_type'],
'type' => $custom['target_type']
];
}
}
$this->component->remove('folders');
}
/**
* Add Files
*
* @param object $versionData
*
* @return void
* @since 3.2.0
*/
private function addFiles(object &$versionData)
{
if (!$this->component->isArray('files')) {
return;
}
// pointer tracker
$pointer_tracker = 'h';
foreach ($this->component->get('files') as $custom)
{
// check type of target type
$_target_type = 'c0mp0n3nt';
if (isset($custom['target_type']))
{
$_target_type = $custom['target_type'];
}
// for good practice
$this->pathfix->set(
$custom, ['path', 'file', 'filepath']
);
// by default custom path is true
$customPath = 'custom';
// set full path if this is a full path file
if (!isset($custom['file']) && isset($custom['filepath']))
{
// update the dynamic path
$custom['filepath'] = $this->dynamicpath->update(
$custom['filepath']
);
// set the file path with / if does not have a drive/windows full path
$custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath']))
? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/');
// remove the file path
unset($custom['filepath']);
// triget fullpath
$customPath = 'full';
}
// make sure we have not duplicates
$key_pointer = StringHelper::safe(
$custom['file']
) . '_g' . $pointer_tracker;
$pointer_tracker++;
// set new file to object
$versionData->move->static->{$key_pointer} = new \stdClass();
$versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']);
// update the dynamic component name placholders in file names
$custom['path'] = $this->placeholder->update_(
$custom['path']
);
// get the path info
$pathInfo = pathinfo((string) $custom['path']);
if (isset($pathInfo['extension']) && $pathInfo['extension'])
{
$pathInfo['dirname'] = trim($pathInfo['dirname'], '/');
// set the info
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname'];
$versionData->move->static->{$key_pointer}->rename = 'new';
$versionData->move->static->{$key_pointer}->newName = $pathInfo['basename'];
}
elseif ('full' === $customPath)
{
// fix custom path
$custom['path'] = ltrim((string) $custom['path'], '/');
// get file array
$fileArray = (array) explode('/', (string) $custom['file']);
// set the info
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
$versionData->move->static->{$key_pointer}->rename = 'new';
$versionData->move->static->{$key_pointer}->newName = end($fileArray);
}
else
{
// fix custom path
$custom['path'] = ltrim((string) $custom['path'], '/');
// set the info
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
$versionData->move->static->{$key_pointer}->rename = false;
}
$versionData->move->static->{$key_pointer}->type = 'file';
$versionData->move->static->{$key_pointer}->custom = $customPath;
// set the target if type and id is found
if (isset($custom['target_id'])
&& isset($custom['target_type']))
{
$versionData->move->static->{$key_pointer}->_target = [
'key' => $custom['target_id'] . '_' . $custom['target_type'],
'type' => $custom['target_type']
];
}
// check if file should be updated
if (!isset($custom['notnew']) || $custom['notnew'] == 0
|| $custom['notnew'] != 1)
{
$this->registry->appendArray('files.not.new', $key_pointer);
}
else
{
// update the file content
$this->registry->set('update.file.content.' . $key_pointer, true);
}
}
$this->component->remove('files');
}
}

View File

@ -0,0 +1,118 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Component\Settings;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder;
use VDM\Joomla\Utilities\ObjectHelper;
/**
* Build/Create Component Structure
*
* @since 3.2.0
*/
class Structure
{
/**
* Compiler Component Joomla Version Settings
*
* @var Settings
* @since 3.2.0
*/
protected Settings $settings;
/**
* Compiler Paths
*
* @var Paths
* @since 3.2.0
*/
protected Paths $paths;
/**
* Compiler Utilities Folder
*
* @var Folder
* @since 3.2.0
*/
protected Folder $folder;
/**
* Constructor
*
* @param Settings|null $settings The compiler component joomla version settings object.
* @param Paths|null $paths The compiler paths object.
* @param Folder|null $folder The compiler folder object.
*
* @since 3.2.0
*/
public function __construct(?Settings $settings = null, ?Paths $paths = null, ?Folder $folder = null)
{
$this->settings = $settings ?: Compiler::_('Component.Settings');
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
$this->folder = $folder ?: Compiler::_('Utilities.Folder');
}
/**
* Build the Component Structure
*
* @return bool
* @since 3.2.0
*/
public function build(): bool
{
if ($this->settings->exists())
{
// setup the main component path
$this->folder->create($this->paths->component_path);
// build the version structure
$this->folders(
$this->settings->structure(),
$this->paths->component_path
);
return true;
}
return false;
}
/**
* Create the folder and subfolders
*
* @param object $folders The object[] of folders
* @param string $path The path
*
* @return void
* @since 3.2.0
*/
protected function folders(object $folders, string $path)
{
foreach ($folders as $folder => $sub_folders)
{
$new_path = $path . '/' . $folder;
$this->folder->create($new_path);
if (ObjectHelper::check($sub_folders))
{
$this->folders($sub_folders, $new_path);
}
}
}
}

View File

@ -0,0 +1,355 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Component\Settings;
use VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate;
use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
/**
* Multiple Files and Folders Builder Class
*
* @since 3.2.0
*/
class Structuremultiple
{
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Component Joomla Version Settings
*
* @var Settings
* @since 3.2.0
*/
protected Settings $settings;
/**
* Compiler Component
*
* @var Component
* @since 3.2.0
**/
protected Component $component;
/**
* Compiler Model Createdate
*
* @var Createdate
* @since 3.2.0
**/
protected Createdate $createdate;
/**
* Compiler Model Modifieddate
*
* @var Modifieddate
* @since 3.2.0
**/
protected Modifieddate $modifieddate;
/**
* Compiler Utility to Build Structure
*
* @var Structure
* @since 3.2.0
**/
protected Structure $structure;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param Settings|null $settings The compiler component Joomla version settings object.
* @param Component|null $component The component class.
* @param Createdate|null $createdate The compiler model to get create date class.
* @param Modifieddate|null $modifieddate The compiler model to get modified date class.
* @param Structure|null $structure The compiler structure to build dynamic folder and files class.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?Settings $settings = null, ?Component $component = null,
?Createdate $createdate = null, ?Modifieddate $modifieddate = null,
?Structure $structure = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->settings = $settings ?: Compiler::_('Component.Settings');
$this->component = $component ?: Compiler::_('Component');
$this->createdate = $createdate ?: Compiler::_('Model.Createdate');
$this->modifieddate = $modifieddate ?: Compiler::_('Model.Modifieddate');
$this->structure = $structure ?: Compiler::_('Utilities.Structure');
}
/**
* Build the Multiple Files & Folders
*
* @return bool
* @since 3.2.0
*/
public function build(): bool
{
$success = false;
if ($this->settings->exists())
{
$success = $this->admin();
$success = $this->site() || $success;
$success = $this->custom() || $success;
}
return $success;
}
/**
* Build the Dynamic Admin Files & Folders
*
* @return bool
* @since 3.2.0
*/
protected function admin(): bool
{
if (!$this->component->isArray('admin_views'))
{
return false;
}
// check if we have a dynamic dashboard
if (!$this->registry->get('build.dashboard'))
{
// setup the default dashboard
$target = ['admin' => $this->component->get('name_code')];
$this->structure->build($target, 'dashboard');
}
$config = [];
$checkin = false;
foreach ($this->component->get('admin_views') as $view)
{
if (!$this->isValidAdminView($view, $config))
{
continue;
}
$this->buildAdminView($view, $config);
// quick set of checkin once
if (!$checkin && isset($view['checkin']) && $view['checkin'] == 1)
{
// switch to add checking to config
$checkin = true;
$this->config->set('add_checkin', $checkin);
}
}
return true;
}
/**
* Build the Dynamic Site Files & Folders
*
* @return bool
* @since 3.2.0
*/
protected function site(): bool
{
if (!$this->component->isArray('site_views'))
{
return false;
}
$config = [];
foreach ($this->component->get('site_views') as $view)
{
if (!$this->isValidView($view, $config))
{
continue;
}
$this->buildView($view, $config, 'site');
}
return true;
}
/**
* Build the Dynamic Custom Admin Files & Folders
*
* @return bool
* @since 3.2.0
*/
protected function custom(): bool
{
if (!$this->component->isArray('custom_admin_views'))
{
return false;
}
$config = [];
foreach ($this->component->get('custom_admin_views') as $view)
{
if (!$this->isValidView($view, $config))
{
continue;
}
$this->buildView($view, $config, 'custom_admin');
}
return true;
}
/**
* Check if the view is a valid view
*
* @param array $view
* @param array $config
*
* @return bool
* @since 3.2.0
*/
private function isValidAdminView(array $view, array &$config): bool
{
if (!isset($view['settings']) || !ObjectHelper::check($view['settings'])
|| ((!isset($view['settings']->name_list) || $view['settings']->name_list == 'null')
&& (!isset($view['settings']->name_single) || $view['settings']->name_single == 'null')))
{
return false;
}
$created = $this->createdate->get($view);
$modified = $this->modifieddate->get($view);
$config = [
Placefix::_h('CREATIONDATE') => $created,
Placefix::_h('BUILDDATE') => $modified,
Placefix::_h('VERSION') => $view['settings']->version
];
return true;
}
/**
* Check if the view is a valid view
*
* @param array $view
* @param array $config
*
* @return bool
* @since 3.2.0
*/
private function isValidView(array $view, array &$config): bool
{
if (!isset($view['settings']) || !ObjectHelper::check($view['settings'])
|| !isset($view['settings']->main_get)
|| !ObjectHelper::check($view['settings']->main_get)
|| !isset($view['settings']->main_get->gettype)
|| ($view['settings']->main_get->gettype != 1 && $view['settings']->main_get->gettype != 2))
{
return false;
}
$created = $this->createdate->get($view);
$modified = $this->modifieddate->get($view);
$config = [
Placefix::_h('CREATIONDATE') => $created,
Placefix::_h('BUILDDATE') => $modified,
Placefix::_h('VERSION') => $view['settings']->version
];
return true;
}
/**
* Build the admin view
*
* @param array $view
* @param array $config
*
* @return void
* @since 3.2.0
*/
private function buildAdminView(array $view, array $config)
{
// build the admin edit view
if ($view['settings']->name_single != 'null')
{
$target = ['admin' => $view['settings']->name_single];
$this->structure->build($target, 'single', false, $config);
// build the site edit view (of this admin view)
if (isset($view['edit_create_site_view'])
&& is_numeric($view['edit_create_site_view'])
&& $view['edit_create_site_view'] > 0)
{
// setup the front site edit-view files
$target = ['site' => $view['settings']->name_single];
$this->structure->build($target, 'edit', false, $config);
}
}
// build the list view
if ($view['settings']->name_list != 'null')
{
$target = ['admin' => $view['settings']->name_list];
$this->structure->build($target, 'list', false, $config);
}
}
/**
* Build the custom view
*
* @param array $view
* @param array $config
* @param string $type
*
* @return void
* @since 3.2.0
*/
private function buildView(array $view, array $config, string $type)
{
$target = [$type => $view['settings']->code];
$view_type = ($view['settings']->main_get->gettype == 1) ? 'single' : 'list';
$this->structure->build($target, $view_type, false, $config);
}
}

View File

@ -0,0 +1,609 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Component;
use Joomla\CMS\Factory;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\File;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Component\Settings;
use VDM\Joomla\Componentbuilder\Compiler\Content;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Component;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
/**
* Single Files and Folders Builder Class
*
* @since 3.2.0
*/
class Structuresingle
{
/**
* The new name
*
* @var string
* @since 3.2.0
*/
protected string $newName;
/**
* Current Full Path
*
* @var string
* @since 3.2.0
*/
protected string $currentFullPath;
/**
* Package Full Path
*
* @var string
* @since 3.2.0
*/
protected string $packageFullPath;
/**
* ZIP Full Path
*
* @var string
* @since 3.2.0
*/
protected string $zipFullPath;
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Component Joomla Version Settings
*
* @var Settings
* @since 3.2.0
*/
protected Settings $settings;
/**
* Compiler Component
*
* @var Component
* @since 3.2.0
**/
protected Component $component;
/**
* Compiler Content
*
* @var Content
* @since 3.2.0
**/
protected Content $content;
/**
* Compiler Counter
*
* @var Counter
* @since 3.2.0
*/
protected Counter $counter;
/**
* Compiler Paths
*
* @var Paths
* @since 3.2.0
*/
protected Paths $paths;
/**
* Compiler Utilities Files
*
* @var Files
* @since 3.2.0
*/
protected Files $files;
/**
* Application object.
*
* @var CMSApplication
* @since 3.2.0
**/
protected CMSApplication $app;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param Settings|null $settings The compiler component Joomla version settings object.
* @param Component|null $component The component class.
* @param Content|null $content The compiler content object.
* @param Counter|null $counter The compiler counter object.
* @param Paths|null $paths The compiler paths object.
* @param Files|null $files The compiler files object.
* @param CMSApplication|null $app The CMS Application object.
*
* @throws \Exception
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?Settings $settings = null, ?Component $component = null,
?Content $content = null, ?Counter $counter = null, ?Paths $paths = null,
?Files $files = null, ?CMSApplication $app = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->settings = $settings ?: Compiler::_('Component.Settings');
$this->component = $component ?: Compiler::_('Component');
$this->content = $content ?: Compiler::_('Content');
$this->counter = $counter ?: Compiler::_('Utilities.Counter');
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
$this->files = $files ?: Compiler::_('Utilities.Files');
$this->app = $app ?: Factory::getApplication();
}
/**
* Build the Single Files & Folders
*
* @return bool
* @since 3.2.0
*/
public function build(): bool
{
if ($this->settings->exists())
{
// TODO needs more looking at this must be dynamic actually
$this->registry->appendArray('files.not.new', 'LICENSE.txt');
// do license check
$LICENSE = $this->doLicenseCheck();
// do README check
$README = $this->doReadmeCheck();
// start moving
foreach ($this->settings->single() as $target => $details)
{
// if not gnu/gpl license dont add the LICENSE.txt file
if ($details->naam === 'LICENSE.txt' && !$LICENSE)
{
continue;
}
// if not needed do not add
if (($details->naam === 'README.md' || $details->naam === 'README.txt')
&& !$README)
{
continue;
}
// set new name
$this->setNewName($details);
// set all paths
$this->setPaths($details);
// check if the path exists
if ($this->pathExist($details))
{
// set the target
$this->setTarget($target, $details);
}
// set dynamic target as needed
$this->setDynamicTarget($details);
}
return true;
}
return false;
}
/**
* Check if license must be added
*
* @return bool
* @since 3.2.0
*/
private function doLicenseCheck(): bool
{
$licenseChecker = strtolower((string) $this->component->get('license', ''));
if (strpos($licenseChecker, 'gnu') !== false
&& strpos(
$licenseChecker, '2'
) !== false
&& (strpos($licenseChecker, 'gpl') !== false
|| strpos(
$licenseChecker, 'General public license'
) !== false))
{
return true;
}
return false;
}
/**
* Check if readme must be added
*
* @return bool
* @since 3.2.0
*/
private function doReadmeCheck(): bool
{
if ($this->component->get('addreadme', false))
{
return true;
}
return false;
}
/**
* Set the new name
*
* @param object $details
*
* @return void
* @since 3.2.0
*/
private function setNewName(object $details)
{
// do the file renaming
if (isset($details->rename) && $details->rename)
{
if ($details->rename === 'new')
{
$this->newName = $details->newName;
}
else
{
$this->newName = str_replace(
$details->rename,
$this->config->component_code_name,
(string) $details->naam
);
}
}
else
{
$this->newName = $details->naam;
}
}
/**
* Set all needed paths
*
* @param object $details
*
* @return void
* @since 3.2.0
*/
private function setPaths(object $details)
{
// check if we have a target value
if (isset($details->_target))
{
// set destination path
$zipPath = str_replace(
$details->_target['type'] . '/', '', (string) $details->path
);
$path = str_replace(
$details->_target['type'] . '/',
$this->registry->get('dynamic_paths.' . $details->_target['key'], '') . '/',
(string) $details->path
);
}
else
{
// set destination path
$zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path);
$path = str_replace(
'c0mp0n3nt/', $this->paths->component_path . '/', (string) $details->path
);
}
// set the template folder path
$templatePath = (isset($details->custom) && $details->custom)
? (($details->custom !== 'full') ? $this->paths->template_path_custom
. '/' : '') : $this->paths->template_path . '/';
// set the final paths
$currentFullPath = (preg_match('/^[a-z]:/i', (string) $details->naam)) ? $details->naam
: $templatePath . '/' . $details->naam;
$this->currentFullPath = str_replace('//', '/', (string) $currentFullPath);
$this->packageFullPath = str_replace('//', '/', $path . '/' . $this->newName);
$this->zipFullPath = str_replace(
'//', '/', $zipPath . '/' . $this->newName
);
}
/**
* Check if path exists
*
* @param object $details
*
* @return bool
* @since 3.2.0
*/
private function pathExist(object $details): bool
{
// check if this has a type
if (!isset($details->type))
{
return false;
}
// take action based on type
elseif ($details->type === 'file' && !File::exists($this->currentFullPath))
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE'), 'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED',
$this->currentFullPath
), 'Error'
);
return false;
}
elseif ($details->type === 'folder' && !Folder::exists($this->currentFullPath))
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE'),
'Error'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED',
$this->currentFullPath
), 'Error'
);
return false;
}
return true;
}
/**
* Set the target based on target type
*
* @param string $target
* @param object $details
*
* @return void
* @since 3.2.0
*/
private function setTarget(string $target, object $details)
{
// take action based on type
if ($details->type === 'file')
{
// move the file
$this->moveFile();
// register the file
$this->registerFile($target, $details);
}
elseif ($details->type === 'folder')
{
// move the folder to its place
Folder::copy(
$this->currentFullPath, $this->packageFullPath, '', true
);
// count the folder created
$this->counter->folder++;
}
}
/**
* Move/Copy the file into place
*
* @return void
* @since 3.2.0
*/
private function moveFile()
{
// get base name && get the path only
$packageFullPath0nly = str_replace(
basename($this->packageFullPath), '', $this->packageFullPath
);
// check if path exist, if not creat it
if (!Folder::exists($packageFullPath0nly))
{
Folder::create($packageFullPath0nly);
}
// move the file to its place
File::copy($this->currentFullPath, $this->packageFullPath);
// count the file created
$this->counter->file++;
}
/**
* Register the file
*
* @param string $target
* @param object $details
*
* @return void
* @since 3.2.0
*/
private function registerFile(string $target, object $details)
{
// store the new files
if (!in_array($target, $this->registry->get('files.not.new', [])))
{
if (isset($details->_target))
{
$this->files->appendArray($details->_target['key'],
[
'path' => $this->packageFullPath,
'name' => $this->newName,
'zip' => $this->zipFullPath
]
);
}
else
{
$this->files->appendArray('static',
[
'path' => $this->packageFullPath,
'name' => $this->newName,
'zip' => $this->zipFullPath
]
);
}
}
// ensure we update this file if needed
if ($this->registry->exists('update.file.content.' . $target))
{
// remove the pointer
$this->registry->remove('update.file.content.' . $target);
// set the full path
$this->registry->set('update.file.content.' . $this->packageFullPath, $this->packageFullPath);
}
}
/**
* Set Dynamic Target
*
* @param object $details
*
* @return void
* @since 3.2.0
*/
private function setDynamicTarget(object $details)
{
// only add if no target found since those belong to plugins and modules
if (!isset($details->_target))
{
// check if we should add the dynamic folder moving script to the installer script
$checker = array_values((array) explode('/', $this->zipFullPath));
// TODO <-- this may not be the best way, will keep an eye on this.
// We basicly only want to check if a folder is added that is not in the stdFolders array
if (isset($checker[0])
&& StringHelper::check($checker[0])
&& !$this->settings->standardFolder($checker[0]))
{
// activate dynamic folders
$this->setDynamicFolders();
}
elseif (count((array) $checker) == 2
&& StringHelper::check($checker[0]))
{
$add_to_extra = false;
// set the target
$eNAME = 'FILES';
$ename = 'filename';
// this should not happen and must have been caught by the above if statment
if ($details->type === 'folder')
{
// only folders outside the standard folder are added
$eNAME = 'FOLDERS';
$ename = 'folder';
$add_to_extra = true;
}
// if this is a file, it can only be added to the admin/site/media folders
// all other folders are moved as a whole so their files do not need to be declared
elseif ($this->settings->standardFolder($checker[0])
&& !$this->settings->standardRootFile($checker[1]))
{
$add_to_extra = true;
}
// add if valid folder/file
if ($add_to_extra)
{
// set the tab
$eTab = Indent::_(2);
if ('admin' === $checker[0])
{
$eTab = Indent::_(3);
}
// set the xml file
$key_ = 'EXSTRA_'
. StringHelper::safe(
$checker[0], 'U'
) . '_' . $eNAME;
$this->content->add($key_,
PHP_EOL . $eTab . "<" . $ename . ">"
. $checker[1] . "</" . $ename . ">");
}
}
}
}
/**
* Add the dynamic folders
*
* @return void
* @since 3.2.0
*/
private function setDynamicFolders()
{
// check if we should add the dynamic folder moving script to the installer script
if (!$this->registry->get('set_move_folders_install_script'))
{
// add the setDynamicF0ld3rs() method to the install scipt.php file
$this->registry->set('set_move_folders_install_script', true);
// set message that this was done (will still add a tutorial link later)
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE'),
'Notice'
);
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'),
'Notice'
);
}
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -12,6 +12,8 @@
namespace VDM\Joomla\Componentbuilder\Compiler;
use Joomla\Registry\Registry as JoomlaRegistry;
use Joomla\CMS\Factory as JoomlaFactory;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig;
@ -20,10 +22,96 @@ use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig;
/**
* Compiler Configurations
*
* All these functions are accessed via the direct name without the get:
* example: $this->component_code_name calls: $this->getComponentcodename()
*
* All values once called are cached, yet can be updated directly:
* example: $this->component_code_name = 'new_code_name'; // be warned!
*
* @since 3.2.0
*/
class Config extends BaseConfig
{
/**
* The Global Joomla Configuration
*
* @var JoomlaRegistry
* @since 3.2.0
*/
protected JoomlaRegistry $config;
/**
* Constructor
*
* @param Input|null $input Input
* @param Registry|null $params The component parameters
* @param Registry|null $config The Joomla configuration
*
* @throws \Exception
* @since 3.2.0
*/
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null, ?JoomlaRegistry $config = null)
{
parent::__construct($input, $params);
$this->config = $config ?: JoomlaFactory::getConfig();
}
/**
* get add contributors switch
*
* @return bool Add contributors switch
* @since 3.2.0
*/
protected function getAddcontributors(): bool
{
return false; // default is false
}
/**
* get Add Ajax Switch
*
* @return bool Add Ajax Switch
* @since 3.2.0
*/
protected function getAddajax(): bool
{
return false; // default is false
}
/**
* get Add Site Ajax Switch
*
* @return bool Add Site Ajax Switch
* @since 3.2.0
*/
protected function getAddsiteajax(): bool
{
return false; // default is false
}
/**
* get add eximport
*
* @return bool add eximport switch
* @since 3.2.0
*/
protected function getAddeximport(): bool
{
return false; // default is false
}
/**
* get add checkin
*
* @return bool add checkin switch
* @since 3.2.0
*/
protected function getAddcheckin(): bool
{
return false; // default is false
}
/**
* get posted component id
*
@ -35,6 +123,17 @@ class Config extends BaseConfig
return $this->input->post->get('component_id', 0, 'INT');
}
/**
* get component version
*
* @return string Component version
* @since 3.2.0
*/
protected function getComponentversion(): string
{
return '1.0.0';
}
/**
* get components code name
*
@ -70,7 +169,7 @@ class Config extends BaseConfig
protected function getComponentcodenamelength(): int
{
// get component name length
return strlen($this->component_code_name);
return strlen((string) $this->component_code_name);
}
/**
@ -81,7 +180,21 @@ class Config extends BaseConfig
*/
protected function getJoomlaversion(): int
{
return $this->input->post->get('joomla_version', 3, 'INT');
return 3; // $this->input->post->get('joomla_version', 3, 'INT');
}
/**
* get Joomla versions
*
* @return array Joomla versions
* @since 3.2.0
*/
protected function getJoomlaversions(): array
{
return [
3 => ['folder_key' => 3, 'xml_version' => 3.9], // only joomla 3
3.10 => ['folder_key' => 3, 'xml_version' => 4.0] // legacy joomla 4
];
}
/**
@ -95,6 +208,28 @@ class Config extends BaseConfig
return StringHelper::safe($this->joomla_version);
}
/**
* set joomla fields
*
* @return bool set joomla fields
* @since 3.2.0
*/
protected function getSetjoomlafields(): bool
{
return false;
}
/**
* get show advanced options switch
*
* @return bool show advanced options
* @since 3.2.0
*/
protected function getShowadvancedoptions(): bool
{
return (bool) $this->input->post->get('show_advanced_options', 0, 'INT');
}
/**
* get indentation value
*
@ -103,7 +238,60 @@ class Config extends BaseConfig
*/
protected function getIndentationvalue(): string
{
return "\t"; // TODO add to GUI as an Global Option?
// if advanced options is active
if ($this->show_advanced_options)
{
$indentation_value = $this->input->post->get('indentation_value', 1, 'INT');
switch($indentation_value)
{
case 2:
// two spaces
return " ";
break;
case 4:
// four spaces
return " ";
break;
}
}
return "\t";
}
/**
* get add build date switch
*
* @return int add build date options
* @since 3.2.0
*/
protected function getAddbuilddate(): int
{
// if advanced options is active
if ($this->show_advanced_options)
{
// 1=default 2=manual 3=component
return $this->input->post->get('add_build_date', 1, 'INT');
}
return 1;
}
/**
* get build date
*
* @return string build date
* @since 3.2.0
*/
protected function getBuilddate(): string
{
// if advanced options is active and manual date selected
if ($this->show_advanced_options && $this->add_build_date == 2)
{
return $this->input->post->get('build_date', 'now', 'STRING');
}
return "now";
}
/**
@ -138,15 +326,12 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('debug_line_nr', 2, 'INT');
// get active value
$add = ($value == 0) ? false : (
($value == 1) ? true : (
((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'debug_linenr' ) == 1) ? true : false
)
);
return $add;
// get global value
if ($value > 1)
{
return (int) GetHelper::var('joomla_component', $this->component_id, 'id', 'debug_linenr');
}
return $value;
}
/**
@ -157,12 +342,11 @@ class Config extends BaseConfig
*/
protected function getMinify(): int
{
// get posted value
$minify = $this->input->post->get('minify', 2, 'INT');
// if value is 2 use global value
$minify = ($minify != 2) ? $minify : $this->params->get('minify', 0);
return $minify;
return ($minify != 2) ? $minify : $this->params->get('minify', 0);
}
/**
@ -173,16 +357,14 @@ class Config extends BaseConfig
*/
protected function getRemovelinebreaks(): bool
{
$value = 2; // 2 is global (use the components value) TODO: get from post
// get active value
$remove = ($value == 0) ? false : (
($value == 1) ? true : (
((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'remove_line_breaks' ) == 1) ? true : false
)
);
return $remove;
// get posted value
$value = $this->input->post->get('remove_line_breaks', 2, 'INT');
// get global
if ($value > 1)
{
return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'remove_line_breaks');
}
return (bool) $value;
}
/**
@ -197,6 +379,30 @@ class Config extends BaseConfig
return \extension_loaded('Tidy');
}
/**
* add tidy warning
*
* @return bool Set tidy warning
* @since 3.2.0
*/
protected function getSettidywarning(): bool
{
// add warning once
return true;
}
/**
* get history tag switch
*
* @return bool get history tag switch
* @since 3.2.0
*/
protected function getSettaghistory(): bool
{
// add warning once
return true;
}
/**
* get language tag
*
@ -206,7 +412,7 @@ class Config extends BaseConfig
protected function getLangtag(): string
{
// get the global language
return $this->params->get('language', 'en-GB');
return $this->params->get('language', 'en-GB');
}
/**
@ -275,11 +481,36 @@ class Config extends BaseConfig
protected function getFieldbuildertype(): int
{
// get the field type builder
return $this->params->get(
return $this->params->get(
'compiler_field_builder_type', 2
);
}
/**
* get default fields
*
* @return array The default fields
* @since 3.2.0
*/
protected function getDefaultfields(): array
{
// get the field type builder
return ['created', 'created_by', 'modified', 'modified_by', 'published',
'ordering', 'access', 'version', 'hits', 'id'];
}
/**
* get temporary path
*
* @return string The temporary path
* @since 3.2.0
*/
protected function getTmppath(): string
{
// get the temporary path
return $this->config->get('tmp_path');
}
/**
* get compiler path
*
@ -289,7 +520,7 @@ class Config extends BaseConfig
protected function getCompilerpath(): string
{
// get the compiler path
return $this->params->get(
return $this->params->get(
'compiler_folder_path',
JPATH_COMPONENT_ADMINISTRATOR . '/compiler'
);
@ -304,7 +535,34 @@ class Config extends BaseConfig
protected function getJcbpowerspath(): string
{
// get jcb powers path
return $this->params->get('jcb_powers_path', 'libraries/jcb_powers');
return $this->params->get('jcb_powers_path', 'libraries/jcb_powers');
}
/**
* get bom path
*
* @return string The bom path
* @since 3.2.0
*/
protected function getBompath(): string
{
// get default bom path
return $this->compiler_path . '/default.txt';
}
/**
* get custom folder path
*
* @return string The custom folder path
* @since 3.2.0
*/
protected function getCustomfolderpath(): string
{
// get the custom folder path
return $this->params->get(
'custom_folder_path',
JPATH_COMPONENT_ADMINISTRATOR . '/custom'
);
}
/**
@ -321,12 +579,50 @@ class Config extends BaseConfig
);
// get component value
$add = (($add_assets_table_fix = (int) GetHelper::var(
return (($add_assets_table_fix = (int) GetHelper::var(
'joomla_component', $this->component_id, 'id',
'assets_table_fix'
)) == 3) ? $global : $add_assets_table_fix;
}
return $add;
/**
* get switch to add assets table name fix
*
* @return bool Switch number to add assets table name fix
* @since 3.2.0
*/
protected function getAddassetstablenamefix(): bool
{
// get global is false
return false;
}
/**
* get access worse case size
*
* @return int access worse case size
* @since 3.2.0
*/
protected function getAccessworsecase(): int
{
// we start at zero
return 0;
}
/**
* get mysql table keys
*
* @return array
* @since 3.2.0
*/
protected function getMysqltablekeys(): array
{
return [
'engine' => ['default' => 'MyISAM'],
'charset' => ['default' => 'utf8'],
'collate' => ['default' => 'utf8_general_ci'],
'row_format' => ['default' => '']
];
}
/**
@ -339,15 +635,12 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('add_placeholders', 2, 'INT');
// get active value
$add = ($value == 0) ? false : (
($value == 1) ? true : (
((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_placeholders' ) == 1) ? true : false
)
);
return $add;
// get global value
if ($value > 1)
{
return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_placeholders');
}
return (bool) $value;
}
/**
@ -360,15 +653,12 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('powers', 2, 'INT');
// get active value
$add = ($value == 0) ? false : (
($value == 1) ? true : (
((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_powers' ) == 1) ? true : false
)
);
return $add;
// get global value
if ($value > 1)
{
return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_powers');
}
return (bool) $value;
}
/**
@ -384,6 +674,17 @@ class Config extends BaseConfig
return 'admin';
}
/**
* get encryption types
*
* @return array encryption types
* @since 3.2.0
*/
protected function getCryptiontypes(): array
{
return ['basic', 'medium', 'whmcs', 'expert'];
}
/**
* get basic encryption switch
*
@ -416,6 +717,72 @@ class Config extends BaseConfig
{
return false;
}
/**
* Should we remove the site folder
*
* @return bool Switch to control the removal
* @since 3.2.0
*/
protected function getRemovesitefolder(): bool
{
return false;
}
/**
* Should we remove the site edit folder
*
* @return bool Switch to control the removal
* @since 3.2.0
*/
protected function getRemovesiteeditfolder(): bool
{
return true;
}
/**
* The Uikit switch
*
* @return int Switch to control the adding uikit
* @since 3.2.0
*/
protected function getUikit(): int
{
return 0; // default its not added
}
/**
* The google chart switch
*
* @return bool Switch to control the adding googlechart
* @since 3.2.0
*/
protected function getGooglechart(): bool
{
return false; // default its not added
}
/**
* The footable switch
*
* @return bool Switch to control the adding footable
* @since 3.2.0
*/
protected function getFootable(): bool
{
return false; // default its not added
}
/**
* The footable version
*
* @return int Switch to control the adding footable
* @since 3.2.0
*/
protected function getFootableversion(): int
{
return 2; // default is version 2
}
}

View File

@ -0,0 +1,67 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
use VDM\Joomla\Componentbuilder\Interfaces\Mapperdoubleinterface;
use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface;
use VDM\Joomla\Componentbuilder\Abstraction\Mapper;
/**
* Compiler Content
*
* @since 3.2.0
*/
class Content extends Mapper implements Mapperdoubleinterface, Mappersingleinterface
{
/**
* Model the key
*
* @param string $key The key to model
*
* @return string
* @since 3.2.0
*/
protected function key(string $key): string
{
return Placefix::_h($key);
}
/**
* Model the first key
*
* @param string $key The first key to model
*
* @return string
* @since 3.2.0
*/
protected function firstKey(string $key): string
{
return $key;
}
/**
* Model the second key
*
* @param string $key The second key to model
*
* @return string
* @since 3.2.0
*/
protected function secondKey(string $key): string
{
return Placefix::_h($key);
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -193,7 +193,7 @@ class Customcode implements CustomcodeInterface
var_dump($string);
}
// the ids found in this content
$bucket = array();
$bucket = [];
$found = GetHelper::allBetween(
$string, '[CUSTO' . 'MCODE=', ']'
);
@ -213,9 +213,9 @@ class Customcode implements CustomcodeInterface
$id = (int) $key;
}
elseif (StringHelper::check($key)
&& strpos($key, '+') === false)
&& strpos((string) $key, '+') === false)
{
$getFuncName = trim($key);
$getFuncName = trim((string) $key);
if (!isset($this->functionNameMemory[$getFuncName]))
{
if (!$found_local = GetHelper::var(
@ -232,10 +232,10 @@ class Customcode implements CustomcodeInterface
}
elseif (StringHelper::check($key)
&& strpos(
$key, '+'
(string) $key, '+'
) !== false)
{
$array = explode('+', $key);
$array = explode('+', (string) $key);
// set ID
if (is_numeric($array[0]))
{
@ -268,7 +268,7 @@ class Customcode implements CustomcodeInterface
{
if (!isset($this->data[$id]['args']))
{
$this->data[$id]['args'] = array();
$this->data[$id]['args'] = [];
}
// only load if not already loaded
if (!isset($this->data[$id]['args'][$key]))
@ -278,20 +278,18 @@ class Customcode implements CustomcodeInterface
// update the function values with the custom code key placeholders (this allow the use of [] + and , in the values)
$this->data[$id]['args'][$key]
= array_map(
function ($_key) {
return $this->placeholder->update(
fn($_key) => $this->placeholder->update(
$_key,
$this->keys
);
}, (array) explode(',', $array[1])
);
), (array) explode(',', $array[1])
);
}
elseif (StringHelper::check(
$array[1]
))
{
$this->data[$id]['args'][$key]
= array();
= [];
// update the function values with the custom code key placeholders (this allow the use of [] + and , in the values)
$this->data[$id]['args'][$key][]
= $this->placeholder->update(
@ -417,7 +415,7 @@ class Customcode implements CustomcodeInterface
$this->db->quoteName('a.from_line') . ' ASC'
); // <--- insure we always add code from top of file
// reset custom code
$this->active = array();
$this->active = [];
}
$query->where($this->db->quoteName('a.published') . ' >= 1');
$this->db->setQuery($query);
@ -428,7 +426,7 @@ class Customcode implements CustomcodeInterface
// open the code
foreach ($bucket as $nr => &$customCode)
{
$customCode['code'] = base64_decode($customCode['code']);
$customCode['code'] = base64_decode((string) $customCode['code']);
// always insure that the external code is loaded
$customCode['code'] = $this->external->set(
$customCode['code']
@ -453,14 +451,14 @@ class Customcode implements CustomcodeInterface
if (isset($customCode['hashtarget']))
{
$customCode['hashtarget'] = explode(
"__", $customCode['hashtarget']
"__", (string) $customCode['hashtarget']
);
// is this a replace code, set end has array
if ($customCode['type'] == 1
&& strpos($customCode['hashendtarget'], '__') !== false)
&& strpos((string) $customCode['hashendtarget'], '__') !== false)
{
$customCode['hashendtarget'] = explode(
"__", $customCode['hashendtarget']
"__", (string) $customCode['hashendtarget']
);
// NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e)
@ -504,7 +502,7 @@ class Customcode implements CustomcodeInterface
*/
protected function insert(array $ids, string $string, int $debug = 0): string
{
$code = array();
$code = [];
// load the code
foreach ($ids as $id)
{
@ -564,8 +562,8 @@ class Customcode implements CustomcodeInterface
var_dump($this->placeholder->active);
}
$code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start']
. PHP_EOL . $this->placeholder->update(
$item['code'], $this->placeholder->active
. PHP_EOL . $this->placeholder->update_(
$item['code']
) . $placeholder['end'];
}
// always clear the args
@ -581,9 +579,9 @@ class Customcode implements CustomcodeInterface
}
// check what type of place holders we should load here
$placeholderType = (int) $item['comment_type'] . '2';
if (stripos($item['code'], Placefix::b() . 'view') !== false
|| stripos($item['code'], Placefix::b() . 'sview') !== false
|| stripos($item['code'], Placefix::b() . 'arg') !== false)
if (stripos((string) $item['code'], Placefix::b() . 'view') !== false
|| stripos((string) $item['code'], Placefix::b() . 'sview') !== false
|| stripos((string) $item['code'], Placefix::b() . 'arg') !== false)
{
// if view is being set dynamicly then we can't update this code via IDE (TODO)
$placeholderType = 3;
@ -596,8 +594,8 @@ class Customcode implements CustomcodeInterface
);
$code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']']
= $placeholder['start'] . PHP_EOL
. $this->placeholder->update(
$item['code'], $this->placeholder->active
. $this->placeholder->update_(
$item['code']
) . $placeholder['end'];
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -117,7 +117,7 @@ class Dispenser implements DispenserInterface
* @since 3.2.0
*/
public function set(&$script, string $first, ?string $second = null, ?string $third = null,
array $config = array(), bool $base64 = true, bool $dynamic = true, bool $add = false): bool
array $config = [], bool $base64 = true, bool $dynamic = true, bool $add = false): bool
{
// only load if we have a string
if (!StringHelper::check($script))
@ -132,7 +132,7 @@ class Dispenser implements DispenserInterface
// check if the script first key is set
if ($second && !isset($this->hub[$first]))
{
$this->hub[$first] = array();
$this->hub[$first] = [];
}
elseif ($add && !$second
&& !isset($this->hub[$first]))
@ -143,7 +143,7 @@ class Dispenser implements DispenserInterface
if ($second && $third
&& !isset($this->hub[$first][$second]))
{
$this->hub[$first][$second] = array();
$this->hub[$first][$second] = [];
}
elseif ($add && $second && !$third
&& !isset($this->hub[$first][$second]))
@ -263,7 +263,7 @@ class Dispenser implements DispenserInterface
$script .= $prefix . str_replace(
array_keys($this->placeholder->active),
array_values($this->placeholder->active),
$this->hub[$first][$second]
(string) $this->hub[$first][$second]
) . $suffix;
// clear some memory
if ($unset)

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -122,7 +122,7 @@ class External implements ExternalInterface
var_dump($string);
}
// target content
$bucket = array();
$bucket = [];
$found = GetHelper::allBetween(
$string, '[EXTERNA' . 'LCODE=', ']'
);
@ -135,18 +135,18 @@ class External implements ExternalInterface
// example: >{3|4
// will cut 3 rows at top and 4 rows at bottom
// if the external code has 8 or more lines
if (($pos = strpos($target, '>{')) !== false)
if (($pos = strpos((string) $target, '>{')) !== false)
{
// the length
$target_len = strlen($target);
$target_len = strlen((string) $target);
// where to cut
$cutting = $target_len - $pos;
// get the sequence
$sequence = substr($target, "-$cutting");
$sequence = substr((string) $target, "-$cutting");
// remove from the URL
$target_url = str_replace($sequence, '', $target);
$target_url = str_replace($sequence, '', (string) $target);
// set the cut key for this target if not set
$this->cutter[trim($target)] = str_replace('>{', '', $sequence);
$this->cutter[trim((string) $target)] = str_replace('>{', '', $sequence);
}
else
{
@ -342,17 +342,9 @@ class External implements ExternalInterface
);
}
}
// add to local bucket
if (isset($this->code[$target_key]))
{
// update the placeholder with the external code string
$bucket[$key] = $this->code[$target_key];
}
else
{
// remove the placeholder
$bucket[$key] = '';
}
$bucket[$key] = $this->code[$target_key] ?? '';
}
/**

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -25,8 +25,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor\Paths;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse;
use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Path;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\ExtractorInterface;
@ -179,6 +179,14 @@ class Extractor implements ExtractorInterface
**/
protected Placeholder $componentPlaceholder;
/**
* Compiler Component Pathfix
*
* @var Pathfix
* @since 3.2.0
**/
protected Pathfix $pathfix;
/**
* Current User Object
*
@ -211,6 +219,7 @@ class Extractor implements ExtractorInterface
* @param Paths|null $paths The compiler customcode extractor paths object.
* @param Reverse|null $reverse The compiler placeholder reverse object.
* @param Placeholder|null $placeholder The compiler component placeholder object.
* @param Pathfix|null $pathfix The compiler path fixing object.
* @param User|null $user The current User object.
* @param \JDatabaseDriver|null $db The Database Driver object.
* @param CMSApplication|null $app The CMS Application object.
@ -219,7 +228,7 @@ class Extractor implements ExtractorInterface
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null,
?Reverse $reverse = null, ?Placeholder $placeholder = null,
?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null,
?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null)
{
$this->config = $config ?: Compiler::_('Config');
@ -227,6 +236,7 @@ class Extractor implements ExtractorInterface
$this->paths = $paths ?: Compiler::_('Customcode.Extractor.Paths');
$this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse');
$this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder');
$this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix');
$this->user = $user ?: Factory::getUser();
$this->db = $db ?: Factory::getDbo();
$this->app = $app ?: Factory::getApplication();
@ -327,16 +337,8 @@ class Extractor implements ExtractorInterface
// make sure we have the path correct (the script file is not in admin path for example)
// there may be more... will nead to keep our eye on this... since files could be moved during install
$file = str_replace('./', '', $file); # TODO (windows path issues)
if ($file !== 'script.php')
{
$path = $target . '/' . $file;
}
else
{
$path = $file;
}
$file = str_replace('./', '', (string) $file); # TODO (windows path issues)
$path = $file !== 'script.php' ? $target . '/' . $file : $file;
// now we go line by line
foreach (new \SplFileObject($file) as $lineNumber => $lineContent)
@ -366,10 +368,10 @@ class Extractor implements ExtractorInterface
// check if the ending placeholder was found
if (isset($reading[$targetKey]) && $reading[$targetKey]
&& ((trim($lineContent) === $end
|| strpos($lineContent, $end) !== false)
|| (trim($lineContent) === $endHTML
|| strpos($lineContent, $endHTML) !== false)))
&& ((trim((string) $lineContent) === $end
|| strpos((string) $lineContent, $end) !== false)
|| (trim((string) $lineContent) === $endHTML
|| strpos((string) $lineContent, $endHTML) !== false)))
{
// trim the placeholder and if there is still data then load it
if (isset($endReplace)
@ -411,7 +413,7 @@ class Extractor implements ExtractorInterface
$this->new[$pointer[$targetKey]][]
= $this->db->quote(
base64_encode($c0de)
base64_encode((string) $c0de)
); // 'code'
if ($_type == 2)
@ -438,7 +440,7 @@ class Extractor implements ExtractorInterface
$this->existing[$pointer[$targetKey]]['fields'][]
= $this->db->quoteName('code') . ' = '
. $this->db->quote(base64_encode($c0de));
. $this->db->quote(base64_encode((string) $c0de));
if ($_type == 2)
{
@ -490,8 +492,8 @@ class Extractor implements ExtractorInterface
// see if the custom code line starts now with PHP/JS comment type
if ((!isset($reading[$targetKey]) || !$reading[$targetKey])
&& (($i === 1 && trim($lineContent) === $start)
|| strpos($lineContent, $start) !== false))
&& (($i === 1 && trim((string) $lineContent) === $start)
|| strpos((string) $lineContent, $start) !== false))
{
$commentType = 1; // PHP/JS type
$startReplace = $start;
@ -500,8 +502,8 @@ class Extractor implements ExtractorInterface
// see if the custom code line starts now with HTML comment type
elseif ((!isset($reading[$targetKey])
|| !$reading[$targetKey])
&& (($i === 1 && trim($lineContent) === $startHTML)
|| strpos($lineContent, $startHTML) !== false))
&& (($i === 1 && trim((string) $lineContent) === $startHTML)
|| strpos((string) $lineContent, $startHTML) !== false))
{
$commentType = 2; // HTML type
$startReplace = $startHTML;
@ -512,7 +514,7 @@ class Extractor implements ExtractorInterface
if ($commentType > 0)
{
// if we have all on one line we have a problem (don't load it TODO)
if (strpos($lineContent, $endReplace) !== false)
if (strpos((string) $lineContent, (string) $endReplace) !== false)
{
// reset found comment type
$commentType = 0;
@ -589,7 +591,7 @@ class Extractor implements ExtractorInterface
);
// for good practice
Path::fix($path);
$this->pathfix->set($path);
// all new records we can do a bulk insert
if ($i === 1 || !$id)

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -130,7 +130,7 @@ class Paths
protected function load()
{
// set the local paths to search
$local_paths = array();
$local_paths = [];
// admin path
$local_paths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'
@ -158,7 +158,7 @@ class Paths
if (($path = $this->getModulePath($module_id)) !== false)
{
// set the path
$local_paths['module_' . str_replace('/', '_', $path)] = $path;
$local_paths['module_' . str_replace('/', '_', (string) $path)] = $path;
}
}
}
@ -172,7 +172,7 @@ class Paths
if (($path = $this->getPluginPath($plugin_id)) !== false)
{
// set the path
$local_paths['plugin_' . str_replace('/', '_', $path)] = JPATH_ROOT . '/plugins/' . $path;
$local_paths['plugin_' . str_replace('/', '_', (string) $path)] = JPATH_ROOT . '/plugins/' . $path;
}
}
}
@ -207,28 +207,20 @@ class Paths
{
$addjoomla_modules = (JsonHelper::check(
$addjoomla_modules
)) ? json_decode($addjoomla_modules, true) : null;
)) ? json_decode((string) $addjoomla_modules, true) : null;
if (ArrayHelper::check($addjoomla_modules))
{
$joomla_modules = array_filter(
array_values($addjoomla_modules),
function ($array) {
// only load the modules whose target association call for it
if (!isset($array['target']) || $array['target'] != 2)
{
return true;
}
return false;
}
// only load the modules whose target association call for it
fn($array): bool => !isset($array['target']) || $array['target'] != 2
);
// if we have values we return IDs
if (ArrayHelper::check($joomla_modules))
{
return array_map(
function ($array) {
return (int) $array['module'];
}, $joomla_modules
fn($array) => (int) $array['module'], $joomla_modules
);
}
}
@ -283,7 +275,7 @@ class Paths
$module->name
);
// set module folder name
$module->folder_name = 'mod_' . strtolower($module->code_name);
$module->folder_name = 'mod_' . strtolower((string) $module->code_name);
// set the lang key
$this->extractor->langKeys[strtoupper($module->folder_name)] =
@ -322,7 +314,8 @@ class Paths
{
$addjoomla_plugins = (JsonHelper::check(
$addjoomla_plugins
)) ? json_decode($addjoomla_plugins, true) : null;
)) ? json_decode((string) $addjoomla_plugins, true) : null;
if (ArrayHelper::check($addjoomla_plugins))
{
$joomla_plugins = array_filter(
@ -341,9 +334,7 @@ class Paths
if (ArrayHelper::check($joomla_plugins))
{
return array_map(
function ($array) {
return (int) $array['plugin'];
}, $joomla_plugins
fn($array) => (int) $array['plugin'], $joomla_plugins
);
}
}
@ -408,9 +399,9 @@ class Paths
);
// set plugin folder name
$plugin->group = strtolower($plugin->group);
$plugin->group = strtolower((string) $plugin->group);
// set plugin file name
$plugin->file_name = strtolower($plugin->code_name);
$plugin->file_name = strtolower((string) $plugin->code_name);
// set the lang key
$this->extractor->langKeys['PLG_' . strtoupper(

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -136,7 +136,7 @@ class Gui implements GuiInterface
$config['prefix'] = PHP_EOL;
}
// add placeholder based on type of code
switch (strtolower($config['type']))
switch (strtolower((string) $config['type']))
{
// adding with html commenting
case 'html':
@ -183,7 +183,7 @@ class Gui implements GuiInterface
// get file content
$file_conent = FileHelper::getContent($file);
$guiCode = array();
$guiCode = [];
// we add a new search for the GUI CODE Blocks
$guiCode[] = GetHelper::allBetween(
$file_conent, '/***[JCB' . 'GUI<>', '/***[/JCBGUI' . '$$$$]***/'
@ -204,7 +204,7 @@ class Gui implements GuiInterface
if (is_array($query) && count($query) >= 3)
{
// cleanup the newlines around the code
$code = trim(str_replace($first_line, '', $code), PHP_EOL)
$code = trim(str_replace($first_line, '', (string) $code), PHP_EOL)
. PHP_EOL;
// set the ID
$id = (int) $query[2];
@ -220,7 +220,7 @@ class Gui implements GuiInterface
$object = new \stdClass();
$object->id = $id;
$object->{$field} = base64_encode(
$code
(string) $code
); // (TODO) this may not always work...
// update the value in GUI
$this->db->updateObject(
@ -243,14 +243,9 @@ class Gui implements GuiInterface
protected function check(string &$code): bool
{
// check for customcode placeholders
if (strpos($code, '$$$$') !== false)
{
// we do not add GUI wrapper placeholder to code
// that already has any customcode placeholders
return false;
}
return true;
// we do not add GUI wrapper placeholder to code
// that already has any customcode placeholders
return strpos($code, '$$$$') === false;
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -56,31 +56,31 @@ class Hash
public function set(string $script): string
{
// check if we should hash a string
if (\strpos($script, 'HASH' . 'STRING((((') !== false)
if (strpos($script, 'HASH' . 'STRING((((') !== false)
{
// get the strings
$values = GetHelper::allBetween(
$script, 'HASH' . 'STRING((((', '))))'
);
$locker = array();
$locker = [];
// convert them
foreach ($values as $value)
{
$locker['HASH' . 'STRING((((' . $value . '))))']
= \md5($value);
= md5((string) $value);
}
// update the script
return $this->placeholder->update($script, $locker);
}
// check if we should hash a file
if (\strpos($script, 'HASH' . 'FILE((((') !== false)
if (strpos($script, 'HASH' . 'FILE((((') !== false)
{
// get the strings
$values = GetHelper::allBetween(
$script, 'HASH' . 'FILE((((', '))))'
);
$locker = array();
$locker = [];
// convert them
foreach ($values as $path)
{
@ -89,7 +89,7 @@ class Hash
{
// now we hash the file content
$locker['HASH' . 'FILE((((' . $path . '))))']
= \md5($value);
= md5((string) $value);
}
else
{

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -62,15 +62,15 @@ class LockBase implements LockBaseInterface
$values = GetHelper::allBetween(
$script, 'LOCK'.'BASE64((((', '))))'
);
$locker = array();
$locker = [];
// convert them
foreach ($values as $value)
{
$locker['LOCK'.'BASE64((((' . $value . '))))']
= "base64_decode( preg_replace('/\s+/', ''," .
PHP_EOL . Indent::_(2) . "'" .
\wordwrap(
\base64_encode($value), 64, PHP_EOL . Indent::_(2), true
wordwrap(
base64_encode((string) $value), 64, PHP_EOL . Indent::_(2), true
) .
"'))";
}

View File

@ -0,0 +1,341 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Customview;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries;
use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout;
use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Data as Dynamicget;
use VDM\Joomla\Componentbuilder\Compiler\Model\Loader;
use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptcustomview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Csscustomview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Phpcustomview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxcustomview;
use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Unique;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Admin Custom View Data Class
*
* @since 3.2.0
*/
class Data
{
/**
* Admin views
*
* @var array
* @since 3.2.0
*/
protected array $data;
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Compiler Event
*
* @var EventInterface
* @since 3.2.0
*/
protected EventInterface $event;
/**
* Compiler Customcode
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode in Gui
*
* @var Gui
* @since 3.2.0
**/
protected Gui $gui;
/**
* Compiler Libraries Model
*
* @var Libraries
* @since 3.2.0
*/
protected Libraries $libraries;
/**
* Compiler Template Layout
*
* @var Templatelayout
* @since 3.2.0
*/
protected Templatelayout $templateLayout;
/**
* Compiler Dynamic Get Data
*
* @var Dynamicget
* @since 3.2.0
*/
protected Dynamicget $dynamic;
/**
* Compiler Auto Loader
*
* @var Loader
* @since 3.2.0
*/
protected Loader $loader;
/**
* The modelling javascript
*
* @var Javascriptcustomview
* @since 3.2.0
*/
protected Javascriptcustomview $javascript;
/**
* The modelling css
*
* @var Csscustomview
* @since 3.2.0
*/
protected Csscustomview $css;
/**
* The modelling php admin view
*
* @var Phpcustomview
* @since 3.2.0
*/
protected Phpcustomview $php;
/**
* The modelling custom buttons
*
* @var Custombuttons
* @since 3.2.0
*/
protected Custombuttons $custombuttons;
/**
* The modelling ajax
*
* @var Ajaxcustomview
* @since 3.2.0
*/
protected Ajaxcustomview $ajax;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param EventInterface|null $event The compiler event api object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Gui|null $gui The compiler customcode gui.
* @param Libraries|null $libraries The compiler libraries model object.
* @param Templatelayout|null $templateLayout The compiler template layout object.
* @param Dynamicget|null $dynamic The compiler dynamic get data object.
* @param Loader|null $loader The compiler loader object.
* @param Javascriptcustomview|null $javascript The modelling javascript object.
* @param Csscustomview|null $css The modelling css object.
* @param Phpcustomview|null $php The modelling php admin view object.
* @param Ajaxcustomview|null $ajax The modelling ajax object.
* @param Custombuttons|null $custombuttons The modelling custombuttons object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?EventInterface $event = null,
?Customcode $customcode = null, ?Gui $gui = null, ?Libraries $libraries = null,
?Templatelayout $templateLayout = null, ?Dynamicget $dynamic = null, ?Loader $loader = null,
?Javascriptcustomview $javascript = null, ?Csscustomview $css = null, ?Phpcustomview $php = null,
?Ajaxcustomview $ajax = null, ?Custombuttons $custombuttons = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->event = $event ?: Compiler::_('Event');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->libraries = $libraries ?: Compiler::_('Model.Libraries');
$this->templateLayout = $templateLayout ?: Compiler::_('Templatelayout.Data');
$this->dynamic = $dynamic ?: Compiler::_('Dynamicget.Data');
$this->loader = $loader ?: Compiler::_('Model.Loader');
$this->javascript = $javascript ?: Compiler::_('Model.Javascriptcustomview');
$this->css = $css ?: Compiler::_('Model.Csscustomview');
$this->php = $php ?: Compiler::_('Model.Phpcustomview');
$this->ajax = $ajax ?: Compiler::_('Model.Ajaxcustomview');
$this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons');
$this->db = $db ?: Factory::getDbo();
}
/**
* Get all Custom View Data
*
* @param int $id The view ID
* @param string $table The view table
*
* @return object|null The view data
* @since 3.2.0
*/
public function get(int $id, string $table = 'site_view'): ?object
{
if (!isset($this->data[$id . $table]))
{
// Create a new query object.
$query = $this->db->getQuery(true);
$query->select('a.*');
$query->from('#__componentbuilder_' . $table . ' AS a');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// for plugin event TODO change event api signatures
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onBeforeQueryCustomViewData
$this->event->trigger(
'jcb_ce_onBeforeQueryCustomViewData',
array(&$component_context, &$id, &$table, &$query, &$this->db)
);
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$item = $this->db->loadObject();
// fix alias to use in code
$item->code = Unique::code(
StringHelper::safe($item->codename), $this->config->build_target
);
$item->Code = StringHelper::safe($item->code, 'F');
$item->CODE = StringHelper::safe($item->code, 'U');
// Trigger Event: jcb_ce_onBeforeModelCustomViewData
$this->event->trigger(
'jcb_ce_onBeforeModelCustomViewData',
array(&$component_context, &$item, &$id, &$table)
);
// set GUI mapper
$guiMapper = [
'table' => $table,
'id' => (int) $id,
'field' => 'default',
'type' => 'html'
];
// set the default data
$item->default = $this->gui->set(
$this->customcode->update(base64_decode((string) $item->default)),
$guiMapper
);
// load context if not set
if (!isset($item->context)
|| !StringHelper::check(
$item->context
))
{
$item->context = $item->code;
}
else
{
// always make sure context is a safe string
$item->context = StringHelper::safe($item->context);
}
// set the libraries
$this->libraries->set($item->code, $item);
// setup template and layout data
$this->templateLayout->set($item->default, $item->code);
// set uikit version 2
$this->loader->uikit($item->code, $item->default);
// auto loaders
$this->loader->set($item->code, $item->default);
// set the main get data
$main_get = $this->dynamic->get(
array($item->main_get), $item->code, $item->context
);
$item->main_get = ArrayHelper::check($main_get) ? $main_get[0] : null;
// set the custom_get data
$item->custom_get = (isset($item->custom_get)
&& JsonHelper::check($item->custom_get))
? json_decode((string) $item->custom_get, true) : null;
if (ArrayHelper::check($item->custom_get))
{
$item->custom_get = $this->dynamic->get(
$item->custom_get, $item->code, $item->context
);
}
// set php scripts
$this->php->set($item, $table);
// set javascript scripts
$this->javascript->set($item, $table);
// set css scripts
$this->css->set($item);
// set Ajax for this view
$this->ajax->set($item, $table);
// set the custom buttons
$this->custombuttons->set($item, $table);
// Trigger Event: jcb_ce_onAfterModelCustomViewData
$this->event->trigger(
'jcb_ce_onAfterModelCustomViewData',
array(&$component_context, &$item)
);
// set the found data
$this->data[$id . $table] = $item;
}
// return the found data
return $this->data[$id . $table];
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,324 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Model\Dynamicget;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Dynamic Get Data Class
*
* @since 3.2.0
*/
class Data
{
/**
* The gui mapper array
*
* @var array
* @since 3.2.0
*/
protected array $guiMapper = [
'table' => 'dynamic_get',
'id' => null,
'field' => null,
'type' => 'php'
];
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Compiler Event
*
* @var EventInterface
* @since 3.2.0
*/
protected EventInterface $event;
/**
* Compiler Customcode
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode Dispenser
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* Compiler Customcode in Gui
*
* @var Gui
* @since 3.2.0
**/
protected Gui $gui;
/**
* Compiler Dynamicget Model
*
* @var Dynamicget
* @since 3.2.0
*/
protected Dynamicget $dynamic;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param EventInterface|null $event The compiler event api object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Dispenser|null $dispenser The compiler customcode dispenser object.
* @param Gui|null $gui The compiler customcode gui.
* @param Dynamicget|null $dynamic The compiler dynamicget modeller object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?EventInterface $event = null, ?Customcode $customcode = null,
?Dispenser $dispenser = null, ?Gui $gui = null,
?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->event = $event ?: Compiler::_('Event');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget');
$this->db = $db ?: Factory::getDbo();
}
/**
* Get Dynamic Get Data
*
* @param array $ids The ids of the dynamic get
* @param string $view_code The view code name
* @param string $context The context for events
*
* @return array|null array of object/s on success
* @since 3.2.0
*/
public function get(array $ids, string $view_code, string $context): ?array
{
if ($ids === [])
{
return null;
}
$ids = implode(',', $ids);
// for plugin event TODO change event api signatures
$component_context = $this->config->component_context;
// Create a new query object.
$query = $this->db->getQuery(true);
$query->select('a.*');
$query->from('#__componentbuilder_dynamic_get AS a');
$query->where('a.id IN (' . $ids . ')');
$this->db->setQuery($query);
$this->db->execute();
if ($this->db->getNumRows())
{
$results = $this->db->loadObjectList();
foreach ($results as $_nr => &$result)
{
// Trigger Event: jcb_ce_onBeforeModelDynamicGetData
$this->event->trigger(
'jcb_ce_onBeforeModelDynamicGetData',
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
);
// set GUI mapper id
$this->guiMapper['id'] = (int) $result->id;
// add calculations if set
if ($result->addcalculation == 1
&& StringHelper::check(
$result->php_calculation
))
{
// set GUI mapper field
$guiMapper['field'] = 'php_calculation';
$result->php_calculation = $this->gui->set(
$this->customcode->update(
base64_decode((string) $result->php_calculation)
),
$this->guiMapper
);
}
// setup the router parse
if (isset($result->add_php_router_parse)
&& $result->add_php_router_parse == 1
&& isset($result->php_router_parse)
&& StringHelper::check(
$result->php_router_parse
))
{
// set GUI mapper field
$this->guiMapper['field'] = 'php_router_parse';
$result->php_router_parse = $this->gui->set(
$this->customcode->update(
base64_decode((string) $result->php_router_parse)
),
$this->guiMapper
);
}
else
{
$result->add_php_router_parse = 0;
}
// The array of the php scripts that should be added to the script builder
$phpSripts = [
'php_before_getitem',
'php_after_getitem',
'php_before_getitems',
'php_after_getitems',
'php_getlistquery'
];
// load the php scripts
foreach ($phpSripts as $script)
{
// add php script to the script builder
if (isset($result->{'add_' . $script})
&& $result->{'add_' . $script} == 1
&& isset($result->{$script})
&& StringHelper::check(
$result->{$script}
))
{
// move all main gets out to the custom script builder
if ($result->gettype <= 2)
{
// set GUI mapper field
$this->guiMapper['field'] = $script;
$this->guiMapper['prefix'] = PHP_EOL . PHP_EOL;
$this->dispenser->set(
$result->{$script},
$this->config->build_target . '_' . $script,
$view_code,
null,
$this->guiMapper,
true,
true,
true
);
unset($this->guiMapper['prefix']);
// remove from local item
unset($result->{$script});
unset($result->{'add_' . $script});
}
else
{
// set GUI mapper field
$this->guiMapper['field'] = $script;
$this->guiMapper['prefix'] = PHP_EOL;
// only for custom gets
$result->{$script} = $this->gui->set(
$this->customcode->update(
base64_decode((string) $result->{$script})
),
$this->guiMapper
);
unset($this->guiMapper['prefix']);
}
}
else
{
// remove from local item
unset($result->{$script});
unset($result->{'add_' . $script});
}
}
// set the getmethod code name
$result->key = StringHelper::safe(
$view_code . ' ' . $result->name . ' ' . $result->id
);
// set the dynamic get
$this->dynamic->set($result, $view_code, $context);
// load the events if any is set
if ($result->gettype == 1
&& JsonHelper::check(
$result->plugin_events
))
{
$result->plugin_events = json_decode(
(string) $result->plugin_events, true
);
}
else
{
$result->plugin_events = '';
}
// Trigger Event: jcb_ce_onAfterModelDynamicGetData
$this->event->trigger(
'jcb_ce_onAfterModelDynamicGetData',
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
);
}
return $results;
}
return null;
}
}

View File

@ -0,0 +1,281 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget;
use Joomla\CMS\Factory;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\Component\Helper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
/**
* Dynamic Get Selection Class
*
* @since 3.2.0
*/
class Selection
{
/**
* Admin view table names
*
* @var array
* @since 3.2.0
*/
protected array $name;
/**
* Compiler Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The compiler registry
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The compiler config object.
* @param Registry|null $registry The compiler registry object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Registry $registry = null,
?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->registry = $registry ?: Compiler::_('Registry');
$this->db = $db ?: Factory::getDbo();
}
/**
* Get Data Selection of the dynamic get
*
* @param string $methodKey The method unique key
* @param string $viewCode The code name of the view
* @param string $string The data string
* @param string $asset The asset in question
* @param string $as The as string
* @param string $type The target type (db||view)
* @param int|null $rowType The row type
*
* @return array|null the select query
* @since 3.2.0
*/
public function get(string $methodKey, string $viewCode,
string $string, string $asset, string $as, string $type, ?int $rowType = null): ?array
{
if (StringHelper::check($string))
{
if ('db' === $type)
{
$table = '#__' . $asset;
$queryName = $asset;
$view = '';
}
elseif ('view' === $type)
{
$view = $this->name($asset);
$table = '#__' . $this->config->component_code_name . '_' . $view;
$queryName = $view;
}
else
{
return null;
}
// just get all values from table if * is found
if ($string === '*' || strpos($string, '*') !== false)
{
if ($type == 'view')
{
// TODO move getViewTableColumns to its own class
$_string = Helper::_('getViewTableColumns',
[$asset, $as, $rowType]
);
}
else
{
// TODO move getDbTableColumns to its own class
$_string = Helper::_('getDbTableColumns',
[$asset, $as, $rowType]
);
}
// get only selected values
$lines = explode(PHP_EOL, (string) $_string);
// make sure to set the string to *
$string = '*';
}
else
{
// get only selected values
$lines = explode(PHP_EOL, $string);
}
// only continue if lines are available
if (ArrayHelper::check($lines))
{
$gets = [];
$keys = [];
// first load all options
foreach ($lines as $line)
{
if (strpos($line, 'AS') !== false)
{
$lineArray = explode("AS", $line);
}
elseif (strpos($line, 'as') !== false)
{
$lineArray = explode("as", $line);
}
else
{
$lineArray = array($line, null);
}
// set the get and key
$get = trim($lineArray[0]);
$key = trim($lineArray[1]);
// only add the view (we must adapt this)
if ($this->registry->exists('builder.get_as_lookup.' . $methodKey . '.' . $get)
&& 'a' != $as
&& is_numeric($rowType) && 1 == $rowType
&& 'view' === $type
&& strpos('#' . $key, '#' . $view . '_') === false)
{
// this is a problem (TODO) since we may want to not add the view name.
$key = $view . '_' . trim($key);
}
// continue only if we have get
if (StringHelper::check($get))
{
$gets[] = $this->db->quote($get);
if (StringHelper::check($key))
{
$this->registry->
set('builder.get_as_lookup.' . $methodKey . '.' . $get, $key);
}
else
{
$key = str_replace(
$as . '.', '', $get
);
$this->registry->
set('builder.get_as_lookup.' . $methodKey . '.' . $get, $key);
}
// set the keys
$keys[] = $this->db->quote(
$key
);
// make sure we have the view name
if (StringHelper::check($view))
{
// prep the field name
$field = str_replace($as . '.', '', $get);
// load to the site fields memory bucket
$this->registry->
set('builder.site_fields.' . $view . '.' . $field . '.' . $methodKey . '___' . $as,
['site' => $viewCode, 'get' => $get, 'as' => $as, 'key' => $key]);
}
}
}
if (ArrayHelper::check($gets)
&& ArrayHelper::check($keys))
{
// single joined selection needs the prefix to the values to avoid conflict in the names
// so we must still add then AS
if ($string == '*' && (is_null($rowType) || 1 != $rowType))
{
$querySelect = "\$query->select('" . $as . ".*');";
}
else
{
$querySelect = '$query->select($db->quoteName('
. PHP_EOL . Indent::_(3) . 'array(' . implode(
',', $gets
) . '),' . PHP_EOL . Indent::_(3) . 'array('
. implode(',', $keys) . ')));';
}
$queryFrom = '$db->quoteName(' . $this->db->quote($table)
. ', ' . $this->db->quote($as) . ')';
// return the select query
return [
'select' => $querySelect,
'from' => $queryFrom,
'name' => $queryName,
'table' => $table,
'type' => $type,
'select_gets' => $gets,
'select_keys' => $keys
];
}
}
}
return null;
}
/**
* Get the Admin view table name
*
* @param int $id The item id to add
*
* @return string the admin view code name
* @since 3.2.0
*/
protected function name(int $id): string
{
// get name if not set
if (!isset($this->name[$id]))
{
$this->name[$id] = StringHelper::safe(
GetHelper::var('admin_view', $id, 'id', 'name_single')
);
}
return $this->name[$id] ?? 'error';
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -144,7 +144,7 @@ class InstallScript implements GetScriptInterface
else
{
// get the flight key
$flight = str_replace('php_', '', $method);
$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

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -13,6 +13,11 @@ namespace VDM\Joomla\Componentbuilder\Compiler;
use Joomla\DI\Container;
use VDM\Joomla\Componentbuilder\Service\Crypt;
use VDM\Joomla\Componentbuilder\Service\Server;
use VDM\Joomla\Componentbuilder\Compiler\Service\Database;
use VDM\Joomla\Componentbuilder\Compiler\Service\Model;
use VDM\Joomla\Componentbuilder\Compiler\Service\Mapper;
use VDM\Joomla\Componentbuilder\Compiler\Service\Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Service\Event;
use VDM\Joomla\Componentbuilder\Compiler\Service\History;
@ -21,8 +26,16 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Service\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Service\Power;
use VDM\Joomla\Componentbuilder\Compiler\Service\Component;
use VDM\Joomla\Componentbuilder\Compiler\Service\Adminview;
use VDM\Joomla\Componentbuilder\Compiler\Service\Library;
use VDM\Joomla\Componentbuilder\Compiler\Service\Customview;
use VDM\Joomla\Componentbuilder\Compiler\Service\Templatelayout;
use VDM\Joomla\Componentbuilder\Compiler\Service\Extension;
use VDM\Joomla\Componentbuilder\Compiler\Service\Field;
use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlamodule;
use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlaplugin;
use VDM\Joomla\Componentbuilder\Compiler\Service\Utilities;
use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface;
/**
@ -30,7 +43,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Field;
*
* @since 3.2.0
*/
abstract class Factory
abstract class Factory implements FactoryInterface
{
/**
* Global Compiler Container
@ -80,7 +93,7 @@ abstract class Factory
}
/**
* Get a the global compiler container
* Get the global compiler container
*
* @return Container
* @since 3.2.0
@ -103,7 +116,12 @@ abstract class Factory
*/
protected static function createContainer(): Container
{
$container = (new Container())
return (new Container())
->registerServiceProvider(new Crypt())
->registerServiceProvider(new Server())
->registerServiceProvider(new Database())
->registerServiceProvider(new Model())
->registerServiceProvider(new Mapper())
->registerServiceProvider(new Compiler())
->registerServiceProvider(new Event())
->registerServiceProvider(new History())
@ -112,10 +130,15 @@ abstract class Factory
->registerServiceProvider(new Customcode())
->registerServiceProvider(new Power())
->registerServiceProvider(new Component())
->registerServiceProvider(new Adminview())
->registerServiceProvider(new Library())
->registerServiceProvider(new Customview())
->registerServiceProvider(new Templatelayout())
->registerServiceProvider(new Extension())
->registerServiceProvider(new Field());
return $container;
->registerServiceProvider(new Field())
->registerServiceProvider(new Joomlamodule())
->registerServiceProvider(new Joomlaplugin())
->registerServiceProvider(new Utilities());
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -102,8 +102,8 @@ class Customcode
= true;
}
if (strpos($field->javascript_view_footer, "token") !== false
|| strpos($field->javascript_view_footer, "task=ajax") !== false)
if (strpos((string) $field->javascript_view_footer, "token") !== false
|| strpos((string) $field->javascript_view_footer, "task=ajax") !== false)
{
if (!isset($this->dispenser->hub['token']))
{
@ -182,8 +182,8 @@ class Customcode
{
$field->javascript_views_footer_decoded = true;
}
if (strpos($field->javascript_views_footer, "token") !== false
|| strpos($field->javascript_views_footer, "task=ajax") !== false)
if (strpos((string) $field->javascript_views_footer, "token") !== false
|| strpos((string) $field->javascript_views_footer, "task=ajax") !== false)
{
if (!isset($this->dispenser->hub['token']))
{

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -196,7 +196,7 @@ class Data
$field->type = $field->fieldtype;
// load the values form params
$field->xml = $this->customcode->update(json_decode($field->xml));
$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);
@ -204,7 +204,7 @@ class Data
// load the type values form type params
$field->properties = (isset($field->properties)
&& JsonHelper::check($field->properties))
? json_decode($field->properties, true) : null;
? json_decode((string) $field->properties, true) : null;
if (ArrayHelper::check($field->properties))
{
$field->properties = array_values($field->properties);
@ -243,16 +243,16 @@ class Data
))
{
$field->initiator_save_key = md5(
$field->initiator_on_save_model
(string) $field->initiator_on_save_model
);
$field->initiator_save = explode(
PHP_EOL, $this->placeholder->update(
$this->customcode->update(
base64_decode(
$field->initiator_on_save_model
PHP_EOL, $this->placeholder->update_(
$this->customcode->update(
base64_decode(
(string) $field->initiator_on_save_model
)
)
), $this->placeholder->active
)
)
);
}
if (StringHelper::check(
@ -260,32 +260,32 @@ class Data
))
{
$field->initiator_get_key = md5(
$field->initiator_on_get_model
(string) $field->initiator_on_get_model
);
$field->initiator_get = explode(
PHP_EOL, $this->placeholder->update(
$this->customcode->update(
base64_decode(
$field->initiator_on_get_model
PHP_EOL, $this->placeholder->update_(
$this->customcode->update(
base64_decode(
(string) $field->initiator_on_get_model
)
)
), $this->placeholder->active
)
)
);
}
// set the field modeling
// set the field modelling
$field->model_field['save'] = explode(
PHP_EOL, $this->placeholder->update(
$this->customcode->update(
base64_decode($field->on_save_model_field)
), $this->placeholder->active
)
PHP_EOL, $this->placeholder->update_(
$this->customcode->update(
base64_decode((string) $field->on_save_model_field)
)
)
);
$field->model_field['get'] = explode(
PHP_EOL, $this->placeholder->update(
$this->customcode->update(
base64_decode($field->on_get_model_field)
), $this->placeholder->active
)
PHP_EOL, $this->placeholder->update_(
$this->customcode->update(
base64_decode((string) $field->on_get_model_field)
)
)
);
// remove the original values
unset(

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -88,9 +88,10 @@ class CoreValidation implements CoreValidationInterface
}
// remove the Rule.php from the name
$this->rules = array_map( function ($name) {
return str_replace(array('./','Rule.php'), '', $name);
}, $rules);
$this->rules = array_map(
fn($name): string => str_replace(array('./','Rule.php'), '', (string) $name),
$rules
);
}
// return rules if found
@ -99,9 +100,10 @@ class CoreValidation implements CoreValidationInterface
// check if the names should be all lowercase
if ($lowercase)
{
return array_map( function($item) {
return strtolower($item);
}, $this->rules);
return array_map(
fn($item): string => strtolower((string) $item),
$this->rules
);
}
return $this->rules;
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -133,8 +133,8 @@ class Name
|| strpos($requeSt_id, '_request_catid') !== false)
{
// keep it then, don't change
$name = $this->placeholder->update(
$requeSt_id, $this->placeholder->active
$name = $this->placeholder->update_(
$requeSt_id
);
}
else
@ -146,20 +146,20 @@ class Name
if (StringHelper::check($listViewName))
{
// check if we should use another Text Name as this views name
$otherName = $this->placeholder->update(
$otherName = $this->placeholder->update_(
GetHelper::between(
$field['settings']->xml, 'othername="', '"'
), $this->placeholder->active
)
);
$otherViews = $this->placeholder->update(
$otherViews = $this->placeholder->update_(
GetHelper::between(
$field['settings']->xml, 'views="', '"'
), $this->placeholder->active
)
);
$otherView = $this->placeholder->update(
$otherView = $this->placeholder->update_(
GetHelper::between(
$field['settings']->xml, 'view="', '"'
), $this->placeholder->active
)
);
// This is to link other view category
if (StringHelper::check($otherName)
@ -198,10 +198,10 @@ class Name
{
// get value from xml
$xml = FieldHelper::safe(
$this->placeholder->update(
$this->placeholder->update_(
GetHelper::between(
$field['settings']->xml, 'name="', '"'
), $this->placeholder->active
)
)
);
// check if a value was found

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -53,7 +53,7 @@ class TypeName
))
{
// search for own custom fields
if (strpos($field['settings']->type_name, '@') !== false)
if (strpos((string) $field['settings']->type_name, '@') !== false)
{
// set own custom field
$field['settings']->own_custom = $field['settings']->type_name;
@ -66,8 +66,8 @@ class TypeName
);
// if custom (we must use the xml value)
if (strtolower($type_name) === 'custom'
|| strtolower($type_name) === 'customuser')
if (strtolower((string) $type_name) === 'custom'
|| strtolower((string) $type_name) === 'customuser')
{
$type = TypeHelper::safe(
GetHelper::between(

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -130,12 +130,12 @@ class Validation
// open and set the validation rule
$this->registry->set("validation.rules.${validation_rule}",
$this->gui->set(
$this->placeholder->update(
$this->placeholder->update_(
$this->customcode->update(
base64_decode(
$php_code
(string) $php_code
)
), $this->placeholder->active
)
),
array(
'table' => 'validation_rule',

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -38,7 +38,7 @@ interface DispenserInterface
* @since 3.2.0
*/
public function set(&$script, string $first, ?string $second = null, ?string $third = null,
array $config = array(), bool $base64 = true, bool $dynamic = true, bool $add = false): bool;
array $config = [], bool $base64 = true, bool $dynamic = true, bool $add = false): bool;
/**
* Get the script from the customcode dispenser

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

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