Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
7edbe20c33
|
|||
e6c02a29f6
|
|||
f44f385159
|
|||
e8abe8e3cf
|
|||
e771e7d243
|
|||
e614f2ec23
|
|||
d28e4c74af
|
|||
a2ec013566
|
|||
4217b22f67
|
|||
6c42b5af61
|
|||
1c7515d0f5
|
|||
9f5c7deec8
|
|||
7759738938
|
|||
461edf5c3f
|
|||
9f30f30b9e
|
|||
f1cb398f7a
|
|||
f2ea22d0ad
|
|||
869a1879cb
|
|||
d4843d6696
|
|||
9db33ad449
|
|||
dcb4f86ee2
|
|||
e6c8805143
|
374
README.md
374
README.md
@ -1,189 +1,189 @@
|
||||
|
||||
# Joomla Component Builder ([JCB](http://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)
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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.6) 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)
|
||||
|
||||
Once installed upgrades are quick and easy via the default [Joomla](https://extensions.joomla.org/extension/component-builder/) upgrade area.
|
||||
|
||||
Some of the Features
|
||||
====================
|
||||
|
||||
+ Fetch Code from IDE and place it back in component during next compilation.
|
||||
+ Add [Joomla custom fields](https://www.youtube.com/watch?v=n5RBmP0uNCM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=75) in any of your components.
|
||||
+ 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 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.
|
||||
+ Unlimited Tables/Views.
|
||||
+ Reusing Views and Fields.
|
||||
+ Runs on Your Own [Joomla](https://extensions.joomla.org/extension/component-builder/) Install.
|
||||
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
|
||||
+ Build data query of extreme complex nature to use in Dynamic/custom views.
|
||||
+ Highly Dynamic/custom Front-end Structures.
|
||||
+ Dynamically setup templates and layouts for Front-end design.
|
||||
+ Integration of the excellent UIKIT lib.
|
||||
+ Integration of the excellent FOOTABLE lib.
|
||||
+ All [Joomla](https://extensions.joomla.org/extension/component-builder/) Standard Field Types (including subforms).
|
||||
+ Strong Implementation of all [Joomla](https://extensions.joomla.org/extension/component-builder/) Form Security.
|
||||
+ Load data via ajax with ease.
|
||||
+ You can add an Update Server to Components you build.
|
||||
+ Build advanced Dynamic front-end forms.
|
||||
+ Dynamic data queries from multiple tables.
|
||||
+ Place in local GIT folder, and publish to sales server.
|
||||
+ Include any amount of custom files and folders during build.
|
||||
+ Static helper class with smart methods already included.
|
||||
+ Static helper methods Can easily be added.
|
||||
+ Direct install from compiler view.
|
||||
+ Integrative with native [Joomla](https://extensions.joomla.org/extension/component-builder/) Categories and Tags.
|
||||
+ Fully Dynamic Search Friendly URL Auto Implementation.
|
||||
+ Custom scripting options all over the MVC structure.
|
||||
+ Permission implementation down to each view, item and field.
|
||||
+ Easy extendible to include other libraries.
|
||||
+ Can include SQL and visioning update link to distribute your component updates via [Joomla](https://extensions.joomla.org/extension/component-builder/) default upgrade of components.
|
||||
+ Easy Export & Import addon to all backend-tables.
|
||||
+ Overriding ability of import concepts in all backend-tables.
|
||||
+ The Batch and Filter implementation on all backend-list views.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
Just Imagine
|
||||
====================
|
||||
|
||||
+ Your Component Back-end can be more advanced then the [Joomla](https://extensions.joomla.org/extension/component-builder/) Article Manager.
|
||||
+ Your Code as Perfectly Unified to the strict [Joomla](https://extensions.joomla.org/extension/component-builder/) Standards.
|
||||
+ Adding Custom Scripting almost anywhere in the MVC structure.
|
||||
+ Import and export feature to all backend-views.
|
||||
+ Batch copy and move/update feature for all backend-views.
|
||||
+ History tracking per/change made on any back-end item.
|
||||
+ Dynamic field control, to show and hide fields in amazing ways.
|
||||
+ Front-end freedom of design that allows for any library to be used.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
You are in Control
|
||||
====================
|
||||
|
||||
+ You can change the licensing template for your components.
|
||||
+ You can change/improve existing field types and add more.
|
||||
+ Line numbers to show where in compiler was the code build.
|
||||
+ You can improve the component since all code are open-source.
|
||||
+ Free updates for the lifetime of the project.
|
||||
+ 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).
|
||||
+ 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.
|
||||
|
||||
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
|
||||
|
||||
To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jcb-packages).
|
||||
|
||||
|
||||
Where can you get support and help?
|
||||
====================
|
||||
|
||||
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
|
||||
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
|
||||
+ [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)
|
||||
+ [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.
|
||||
|
||||
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.
|
||||
|
||||
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
|
||||
|
||||
WHY GIVE IT AWAY LIKE THIS?
|
||||
====================
|
||||
|
||||
> We are Open Source Enthusiast
|
||||
> Who Support the [Joomla](https://extensions.joomla.org/extension/component-builder/) Community
|
||||
|
||||
Our idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
|
||||
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
# Build Details
|
||||
|
||||
+ *Community*: [Vast Development Method](https://dev.vdm.io)
|
||||
+ *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*: 20th September, 2022
|
||||
+ *Version*: 3.1.6
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **331597**
|
||||
+ *Field count*: **2004**
|
||||
+ *File count*: **2169**
|
||||
+ *Folder count*: **375**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
|
||||
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
|
||||
|
||||
## Contributors
|
||||
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
|
||||
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
|
||||
|
||||
### Backers
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder#backers)
|
||||
|
||||
### Sponsors
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)
|
||||
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)
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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.13) 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)
|
||||
|
||||
Once installed upgrades are quick and easy via the default [Joomla](https://extensions.joomla.org/extension/component-builder/) upgrade area.
|
||||
|
||||
Some of the Features
|
||||
====================
|
||||
|
||||
+ Fetch Code from IDE and place it back in component during next compilation.
|
||||
+ Add [Joomla custom fields](https://www.youtube.com/watch?v=n5RBmP0uNCM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=75) in any of your components.
|
||||
+ 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](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.
|
||||
+ Unlimited Tables/Views.
|
||||
+ Reusing Views and Fields.
|
||||
+ Runs on Your Own [Joomla](https://extensions.joomla.org/extension/component-builder/) Install.
|
||||
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
|
||||
+ Build data query of extreme complex nature to use in Dynamic/custom views.
|
||||
+ Highly Dynamic/custom Front-end Structures.
|
||||
+ Dynamically setup templates and layouts for Front-end design.
|
||||
+ Integration of the excellent UIKIT lib.
|
||||
+ Integration of the excellent FOOTABLE lib.
|
||||
+ All [Joomla](https://extensions.joomla.org/extension/component-builder/) Standard Field Types (including subforms).
|
||||
+ Strong Implementation of all [Joomla](https://extensions.joomla.org/extension/component-builder/) Form Security.
|
||||
+ Load data via ajax with ease.
|
||||
+ You can add an Update Server to Components you build.
|
||||
+ Build advanced Dynamic front-end forms.
|
||||
+ Dynamic data queries from multiple tables.
|
||||
+ Place in local GIT folder, and publish to sales server.
|
||||
+ Include any amount of custom files and folders during build.
|
||||
+ Static helper class with smart methods already included.
|
||||
+ Static helper methods Can easily be added.
|
||||
+ Direct install from compiler view.
|
||||
+ Integrative with native [Joomla](https://extensions.joomla.org/extension/component-builder/) Categories and Tags.
|
||||
+ Fully Dynamic Search Friendly URL Auto Implementation.
|
||||
+ Custom scripting options all over the MVC structure.
|
||||
+ Permission implementation down to each view, item and field.
|
||||
+ Easy extendible to include other libraries.
|
||||
+ Can include SQL and visioning update link to distribute your component updates via [Joomla](https://extensions.joomla.org/extension/component-builder/) default upgrade of components.
|
||||
+ Easy Export & Import addon to all backend-tables.
|
||||
+ Overriding ability of import concepts in all backend-tables.
|
||||
+ The Batch and Filter implementation on all backend-list views.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
Just Imagine
|
||||
====================
|
||||
|
||||
+ Your Component Back-end can be more advanced then the [Joomla](https://extensions.joomla.org/extension/component-builder/) Article Manager.
|
||||
+ Your Code as Perfectly Unified to the strict [Joomla](https://extensions.joomla.org/extension/component-builder/) Standards.
|
||||
+ Adding Custom Scripting almost anywhere in the MVC structure.
|
||||
+ Import and export feature to all backend-views.
|
||||
+ Batch copy and move/update feature for all backend-views.
|
||||
+ History tracking per/change made on any back-end item.
|
||||
+ Dynamic field control, to show and hide fields in amazing ways.
|
||||
+ Front-end freedom of design that allows for any library to be used.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
You are in Control
|
||||
====================
|
||||
|
||||
+ You can change the licensing template for your components.
|
||||
+ You can change/improve existing field types and add more.
|
||||
+ Line numbers to show where in compiler was the code build.
|
||||
+ You can improve the component since all code are open-source.
|
||||
+ Free updates for the lifetime of the project.
|
||||
+ 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](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](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)!
|
||||
|
||||
To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jcb-packages).
|
||||
|
||||
|
||||
Where can you get support and help?
|
||||
====================
|
||||
|
||||
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
|
||||
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
|
||||
+ [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](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](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.
|
||||
|
||||
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
|
||||
|
||||
WHY GIVE IT AWAY LIKE THIS?
|
||||
====================
|
||||
|
||||
> We are Open Source Enthusiast
|
||||
> Who Support the [Joomla](https://extensions.joomla.org/extension/component-builder/) Community
|
||||
|
||||
Our idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
|
||||
|
||||
MAKING IT BETTER!
|
||||
====================
|
||||
|
||||
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](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
|
||||
|
||||
+ *Community*: [Vast Development Method](https://dev.vdm.io)
|
||||
+ *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*: 29th January, 2023
|
||||
+ *Version*: 3.1.13
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **360674**
|
||||
+ *Field count*: **2009**
|
||||
+ *File count*: **2314**
|
||||
+ *Folder count*: **408**
|
||||
|
||||
> 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)
|
||||
|
||||
|
||||
## Contributors
|
||||
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
|
||||
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
|
||||
|
||||
### Backers
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder#backers)
|
||||
|
||||
### Sponsors
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)
|
||||
|
374
admin/README.txt
374
admin/README.txt
@ -1,189 +1,189 @@
|
||||
|
||||
# Joomla Component Builder ([JCB](http://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)
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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.6) 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)
|
||||
|
||||
Once installed upgrades are quick and easy via the default [Joomla](https://extensions.joomla.org/extension/component-builder/) upgrade area.
|
||||
|
||||
Some of the Features
|
||||
====================
|
||||
|
||||
+ Fetch Code from IDE and place it back in component during next compilation.
|
||||
+ Add [Joomla custom fields](https://www.youtube.com/watch?v=n5RBmP0uNCM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=75) in any of your components.
|
||||
+ 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 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.
|
||||
+ Unlimited Tables/Views.
|
||||
+ Reusing Views and Fields.
|
||||
+ Runs on Your Own [Joomla](https://extensions.joomla.org/extension/component-builder/) Install.
|
||||
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
|
||||
+ Build data query of extreme complex nature to use in Dynamic/custom views.
|
||||
+ Highly Dynamic/custom Front-end Structures.
|
||||
+ Dynamically setup templates and layouts for Front-end design.
|
||||
+ Integration of the excellent UIKIT lib.
|
||||
+ Integration of the excellent FOOTABLE lib.
|
||||
+ All [Joomla](https://extensions.joomla.org/extension/component-builder/) Standard Field Types (including subforms).
|
||||
+ Strong Implementation of all [Joomla](https://extensions.joomla.org/extension/component-builder/) Form Security.
|
||||
+ Load data via ajax with ease.
|
||||
+ You can add an Update Server to Components you build.
|
||||
+ Build advanced Dynamic front-end forms.
|
||||
+ Dynamic data queries from multiple tables.
|
||||
+ Place in local GIT folder, and publish to sales server.
|
||||
+ Include any amount of custom files and folders during build.
|
||||
+ Static helper class with smart methods already included.
|
||||
+ Static helper methods Can easily be added.
|
||||
+ Direct install from compiler view.
|
||||
+ Integrative with native [Joomla](https://extensions.joomla.org/extension/component-builder/) Categories and Tags.
|
||||
+ Fully Dynamic Search Friendly URL Auto Implementation.
|
||||
+ Custom scripting options all over the MVC structure.
|
||||
+ Permission implementation down to each view, item and field.
|
||||
+ Easy extendible to include other libraries.
|
||||
+ Can include SQL and visioning update link to distribute your component updates via [Joomla](https://extensions.joomla.org/extension/component-builder/) default upgrade of components.
|
||||
+ Easy Export & Import addon to all backend-tables.
|
||||
+ Overriding ability of import concepts in all backend-tables.
|
||||
+ The Batch and Filter implementation on all backend-list views.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
Just Imagine
|
||||
====================
|
||||
|
||||
+ Your Component Back-end can be more advanced then the [Joomla](https://extensions.joomla.org/extension/component-builder/) Article Manager.
|
||||
+ Your Code as Perfectly Unified to the strict [Joomla](https://extensions.joomla.org/extension/component-builder/) Standards.
|
||||
+ Adding Custom Scripting almost anywhere in the MVC structure.
|
||||
+ Import and export feature to all backend-views.
|
||||
+ Batch copy and move/update feature for all backend-views.
|
||||
+ History tracking per/change made on any back-end item.
|
||||
+ Dynamic field control, to show and hide fields in amazing ways.
|
||||
+ Front-end freedom of design that allows for any library to be used.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
You are in Control
|
||||
====================
|
||||
|
||||
+ You can change the licensing template for your components.
|
||||
+ You can change/improve existing field types and add more.
|
||||
+ Line numbers to show where in compiler was the code build.
|
||||
+ You can improve the component since all code are open-source.
|
||||
+ Free updates for the lifetime of the project.
|
||||
+ 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).
|
||||
+ 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.
|
||||
|
||||
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
|
||||
|
||||
To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jcb-packages).
|
||||
|
||||
|
||||
Where can you get support and help?
|
||||
====================
|
||||
|
||||
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
|
||||
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
|
||||
+ [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)
|
||||
+ [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.
|
||||
|
||||
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.
|
||||
|
||||
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
|
||||
|
||||
WHY GIVE IT AWAY LIKE THIS?
|
||||
====================
|
||||
|
||||
> We are Open Source Enthusiast
|
||||
> Who Support the [Joomla](https://extensions.joomla.org/extension/component-builder/) Community
|
||||
|
||||
Our idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
|
||||
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
# Build Details
|
||||
|
||||
+ *Community*: [Vast Development Method](https://dev.vdm.io)
|
||||
+ *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*: 20th September, 2022
|
||||
+ *Version*: 3.1.6
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **331597**
|
||||
+ *Field count*: **2004**
|
||||
+ *File count*: **2169**
|
||||
+ *Folder count*: **375**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
|
||||
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
|
||||
|
||||
## Contributors
|
||||
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
|
||||
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
|
||||
|
||||
### Backers
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder#backers)
|
||||
|
||||
### Sponsors
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)
|
||||
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)
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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.13) 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)
|
||||
|
||||
Once installed upgrades are quick and easy via the default [Joomla](https://extensions.joomla.org/extension/component-builder/) upgrade area.
|
||||
|
||||
Some of the Features
|
||||
====================
|
||||
|
||||
+ Fetch Code from IDE and place it back in component during next compilation.
|
||||
+ Add [Joomla custom fields](https://www.youtube.com/watch?v=n5RBmP0uNCM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=75) in any of your components.
|
||||
+ 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](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.
|
||||
+ Unlimited Tables/Views.
|
||||
+ Reusing Views and Fields.
|
||||
+ Runs on Your Own [Joomla](https://extensions.joomla.org/extension/component-builder/) Install.
|
||||
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
|
||||
+ Build data query of extreme complex nature to use in Dynamic/custom views.
|
||||
+ Highly Dynamic/custom Front-end Structures.
|
||||
+ Dynamically setup templates and layouts for Front-end design.
|
||||
+ Integration of the excellent UIKIT lib.
|
||||
+ Integration of the excellent FOOTABLE lib.
|
||||
+ All [Joomla](https://extensions.joomla.org/extension/component-builder/) Standard Field Types (including subforms).
|
||||
+ Strong Implementation of all [Joomla](https://extensions.joomla.org/extension/component-builder/) Form Security.
|
||||
+ Load data via ajax with ease.
|
||||
+ You can add an Update Server to Components you build.
|
||||
+ Build advanced Dynamic front-end forms.
|
||||
+ Dynamic data queries from multiple tables.
|
||||
+ Place in local GIT folder, and publish to sales server.
|
||||
+ Include any amount of custom files and folders during build.
|
||||
+ Static helper class with smart methods already included.
|
||||
+ Static helper methods Can easily be added.
|
||||
+ Direct install from compiler view.
|
||||
+ Integrative with native [Joomla](https://extensions.joomla.org/extension/component-builder/) Categories and Tags.
|
||||
+ Fully Dynamic Search Friendly URL Auto Implementation.
|
||||
+ Custom scripting options all over the MVC structure.
|
||||
+ Permission implementation down to each view, item and field.
|
||||
+ Easy extendible to include other libraries.
|
||||
+ Can include SQL and visioning update link to distribute your component updates via [Joomla](https://extensions.joomla.org/extension/component-builder/) default upgrade of components.
|
||||
+ Easy Export & Import addon to all backend-tables.
|
||||
+ Overriding ability of import concepts in all backend-tables.
|
||||
+ The Batch and Filter implementation on all backend-list views.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
Just Imagine
|
||||
====================
|
||||
|
||||
+ Your Component Back-end can be more advanced then the [Joomla](https://extensions.joomla.org/extension/component-builder/) Article Manager.
|
||||
+ Your Code as Perfectly Unified to the strict [Joomla](https://extensions.joomla.org/extension/component-builder/) Standards.
|
||||
+ Adding Custom Scripting almost anywhere in the MVC structure.
|
||||
+ Import and export feature to all backend-views.
|
||||
+ Batch copy and move/update feature for all backend-views.
|
||||
+ History tracking per/change made on any back-end item.
|
||||
+ Dynamic field control, to show and hide fields in amazing ways.
|
||||
+ Front-end freedom of design that allows for any library to be used.
|
||||
+ This and much much more are all possible with this component builder!
|
||||
|
||||
You are in Control
|
||||
====================
|
||||
|
||||
+ You can change the licensing template for your components.
|
||||
+ You can change/improve existing field types and add more.
|
||||
+ Line numbers to show where in compiler was the code build.
|
||||
+ You can improve the component since all code are open-source.
|
||||
+ Free updates for the lifetime of the project.
|
||||
+ 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](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](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)!
|
||||
|
||||
To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jcb-packages).
|
||||
|
||||
|
||||
Where can you get support and help?
|
||||
====================
|
||||
|
||||
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
|
||||
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
|
||||
+ [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](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](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.
|
||||
|
||||
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
|
||||
|
||||
WHY GIVE IT AWAY LIKE THIS?
|
||||
====================
|
||||
|
||||
> We are Open Source Enthusiast
|
||||
> Who Support the [Joomla](https://extensions.joomla.org/extension/component-builder/) Community
|
||||
|
||||
Our idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
|
||||
|
||||
MAKING IT BETTER!
|
||||
====================
|
||||
|
||||
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](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
|
||||
|
||||
+ *Community*: [Vast Development Method](https://dev.vdm.io)
|
||||
+ *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*: 29th January, 2023
|
||||
+ *Version*: 3.1.13
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **360674**
|
||||
+ *Field count*: **2009**
|
||||
+ *File count*: **2314**
|
||||
+ *Folder count*: **408**
|
||||
|
||||
> 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)
|
||||
|
||||
|
||||
## Contributors
|
||||
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
|
||||
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
|
||||
|
||||
### Backers
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder#backers)
|
||||
|
||||
### Sponsors
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
|
||||
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
|
||||
[](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)
|
||||
|
@ -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" />
|
||||
|
@ -10,4 +10,31 @@
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
.selected {
|
||||
background-color:#d7d8db !important
|
||||
}
|
||||
tr.selected td {
|
||||
background-color:#d7d8db !important
|
||||
}
|
||||
#search_settings_block .controls {
|
||||
margin-left: 1px !important;
|
||||
}
|
||||
tr {
|
||||
cursor:pointer
|
||||
}
|
||||
.found_code {
|
||||
color: #46a546;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.search_details_title {
|
||||
font-size: large;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.small_column {
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
th.small_column {
|
||||
padding: 2px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
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 |
BIN
admin/assets/images/icons/search.png
Normal file
BIN
admin/assets/images/icons/search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB |
956
admin/assets/js/search.js
Normal file
956
admin/assets/js/search.js
Normal file
@ -0,0 +1,956 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
/* JS Document */
|
||||
/**
|
||||
* JS Function to execute the search
|
||||
*/
|
||||
const doSearch = async (signal, tables) => {
|
||||
try {
|
||||
// build form
|
||||
const formData = new FormData();
|
||||
|
||||
// load the result table
|
||||
const resultsTable = new DataTable('#search_results_table');
|
||||
|
||||
// get the search mode
|
||||
let typeSearch = modeObject.querySelector('input[type=\'radio\']:checked').value;
|
||||
|
||||
// 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', 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;
|
||||
|
||||
// reset the progress bar
|
||||
searchProgressBarObject.style.width = '0%';
|
||||
searchProgressBarObject.innerHTML = '0%';
|
||||
|
||||
// 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();
|
||||
|
||||
// reset our global counters
|
||||
fieldCount = 0;
|
||||
lineCount = 0;
|
||||
|
||||
// set our local counters
|
||||
let total = 0;
|
||||
let progress = tables.length;
|
||||
let index;
|
||||
|
||||
for (index = 0; index < progress; index++) {
|
||||
|
||||
let tableName = tables[index];
|
||||
|
||||
// add the table name
|
||||
formData.set('table_name', tableName);
|
||||
|
||||
let options = {
|
||||
signal: signal,
|
||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||
body: formData
|
||||
}
|
||||
|
||||
if (abort_this_search_values) {
|
||||
break;
|
||||
}
|
||||
const response = await fetch(UrlAjax + 'doSearch', options).then(response => {
|
||||
total++;
|
||||
// return the json response
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'});
|
||||
}
|
||||
}).then((data) => {
|
||||
if (typeof data.success !== 'undefined') {
|
||||
UIkit.notify(data.success, {pos:'top-right', timeout : 200, status:'success'});
|
||||
//} else if (typeof data.not_found !== 'undefined') {
|
||||
// UIkit.notify(data.not_found, {pos:'bottom-right', timeout : 200});
|
||||
}
|
||||
if (typeof data.items !== 'undefined') {
|
||||
addTableItems(resultsTable, data.items, typeSearch);
|
||||
}
|
||||
if (typeof data.fields_count !== 'undefined') {
|
||||
fieldCount += data.fields_count;
|
||||
}
|
||||
if (typeof data.line_count !== 'undefined') {
|
||||
lineCount += data.line_count;
|
||||
}
|
||||
// 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
|
||||
if (progress == total) {
|
||||
let total_field_line = ' ' + fieldCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_FIELDS_THAT_HAD') + ' ' + lineCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_LINES') + ' ';
|
||||
if (progress == 1) {
|
||||
searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + tableName + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS');
|
||||
} 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';
|
||||
}, 13000);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
if (error.name === "AbortError") {
|
||||
abort_this_search_values = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
// Executed regardless if we caught the error
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* JS Function to start search timer
|
||||
*/
|
||||
const startSearchTimer = () => {
|
||||
startSearchTime = new Date();
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to get search lenght
|
||||
*/
|
||||
const getSearchLenght = () => {
|
||||
// set ending time
|
||||
endSearchTime = new Date();
|
||||
|
||||
// get diff in ms
|
||||
var timeDiff = endSearchTime - startSearchTime;
|
||||
|
||||
// strip the ms
|
||||
timeDiff /= 1000;
|
||||
|
||||
// get seconds
|
||||
return Math.round(timeDiff);
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to fetch selected item
|
||||
*/
|
||||
const getSelectedItem = async (table, row, field, line) => {
|
||||
try {
|
||||
// get the search mode
|
||||
let mode = modeObject.querySelector('input[type=\'radio\']:checked').value;
|
||||
|
||||
// build form
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append('field_name', field);
|
||||
formData.append('row_id', row);
|
||||
formData.append('table_name', table);
|
||||
formData.append('search_value', searchObject.value);
|
||||
formData.append('replace_value', replaceObject.value);
|
||||
formData.append('match_case', matchObject.checked ? 1 : 0);
|
||||
formData.append('whole_word', wholeObject.checked ? 1 : 0);
|
||||
formData.append('regex_search', regexObject.checked ? 1 : 0);
|
||||
|
||||
// get search value
|
||||
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 = {
|
||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||
body: formData
|
||||
}
|
||||
|
||||
const response = await fetch(postURL, options).then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
}).then((data) => {
|
||||
if (typeof data.success !== 'undefined') {
|
||||
UIkit.notify(data.success, {pos:'top-right', status:'success'});
|
||||
}
|
||||
if (typeof data.value !== 'undefined') {
|
||||
addSelectedItem(data.value, table, row, field, line);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
// Executed regardless if we caught the error
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 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_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
|
||||
UIkit.modal.confirm(question, function () {
|
||||
|
||||
// show the search settings again
|
||||
showSearch();
|
||||
|
||||
// Create new controller and issue new request
|
||||
controller_replace = new AbortController();
|
||||
|
||||
// check if any specific table was set
|
||||
let tables = [];
|
||||
let table = tableObject.value;
|
||||
if (table != -1) {
|
||||
tables.push(table);
|
||||
replaceAll(controller_replace.signal, tables);
|
||||
} else {
|
||||
replaceAll(controller_replace.signal, searchTables);
|
||||
}
|
||||
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES_UPDATE_ALL'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to execute the search
|
||||
*/
|
||||
const replaceAll = async (signal, tables) => {
|
||||
try {
|
||||
// build form
|
||||
const formData = new FormData();
|
||||
|
||||
// get the search mode
|
||||
let typeSearch = modeObject.querySelector('input[type=\'radio\']:checked').value;
|
||||
|
||||
// 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', matchValue);
|
||||
formData.append('whole_word', wholeValue);
|
||||
formData.append('regex_search', regexValue);
|
||||
|
||||
// reset the progress bar
|
||||
replaceProgressBarObject.style.width = '0%';
|
||||
|
||||
// show the progress bar
|
||||
replaceProgressObject.style.display = '';
|
||||
|
||||
let abort_this_replace_values = false;
|
||||
|
||||
let total = 0;
|
||||
let progress = tables.length;
|
||||
let index;
|
||||
|
||||
for (index = 0; index < progress; index++) {
|
||||
|
||||
let tableName = tables[index];
|
||||
|
||||
// add the table name
|
||||
formData.set('table_name', tableName);
|
||||
|
||||
let options = {
|
||||
signal: signal,
|
||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||
body: formData
|
||||
}
|
||||
|
||||
if (abort_this_replace_values) {
|
||||
break;
|
||||
}
|
||||
const response = await fetch(UrlAjax + 'replaceAll', options).then(response => {
|
||||
total++;
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'});
|
||||
}
|
||||
}).then((data) => {
|
||||
if (typeof data.success !== 'undefined') {
|
||||
UIkit.notify(data.success, {pos:'top-right', timeout : 200, status:'success'});
|
||||
} else if (typeof data.error !== 'undefined') {
|
||||
UIkit.notify(data.error, {pos:'bottom-right', timeout : 200});
|
||||
}
|
||||
// calculate the percent
|
||||
let percent = 100.0 * (total / progress);
|
||||
// update the progress bar
|
||||
replaceProgressBarObject.style.width = percent.toFixed(2) + '%';
|
||||
// when complete hide the progress bar
|
||||
if (progress == total) {
|
||||
setTimeout(function () {
|
||||
// hide the progress bar again
|
||||
replaceProgressObject.style.display = 'none';
|
||||
// we clear the table again
|
||||
clearAll();
|
||||
// if not reqex we reverse the search for you so you can see the update was a success
|
||||
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(){
|
||||
startNewSearch(replaceValue, searchValue, matchValue, wholeValue, regexValue, 2);
|
||||
}, function () {
|
||||
UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){
|
||||
startSearch();
|
||||
}, function () {
|
||||
clearSearch();
|
||||
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
|
||||
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
|
||||
} 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(){
|
||||
startSearch();
|
||||
}, function () {
|
||||
clearSearch();
|
||||
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
if (error.name === "AbortError") {
|
||||
abort_this_replace_values = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
// Executed regardless if we caught the error
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to check if we should save/update the current selected item
|
||||
*/
|
||||
const setValueCheck = (row, field, table) => {
|
||||
// load question
|
||||
let question = Joomla.JText._('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW') + ' (' + row + ') -> (' + field + ') ' +
|
||||
Joomla.JText._('COM_COMPONENTBUILDER_FIELD_IN_THE') + ' (' + table + ') ' + Joomla.JText._('COM_COMPONENTBUILDER_TABLE') + '.<br /><br />' +
|
||||
Joomla.JText._('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE');
|
||||
// do check
|
||||
UIkit.modal.confirm(question, function () {
|
||||
setValue(row, field, table);
|
||||
}, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to set the current selected item
|
||||
*/
|
||||
const setValue = async (row, field, table) => {
|
||||
try {
|
||||
// get the value from the editor
|
||||
let value = editorObject.getValue();
|
||||
|
||||
// build form
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append('value', value);
|
||||
formData.append('row_id', row);
|
||||
formData.append('field_name', field);
|
||||
formData.append('table_name', table);
|
||||
|
||||
let options = {
|
||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||
body: formData
|
||||
}
|
||||
|
||||
const response = await fetch(UrlAjax + 'setValue', options).then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
}).then((data) => {
|
||||
if (typeof data.success !== 'undefined') {
|
||||
UIkit.notify(data.success, {pos:'top-right', status:'success'});
|
||||
clearSelectedItem();
|
||||
tableActiveObject.remove().draw();
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
// Executed regardless if we caught the error
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to add item to the editor
|
||||
*/
|
||||
const addSelectedItem = async (value, table, row, field, line) => {
|
||||
// display area
|
||||
if (value.length > 1)
|
||||
{
|
||||
// add value to editor
|
||||
editorObject.setValue(value);
|
||||
|
||||
// set item details notice area
|
||||
itemNoticeObject.style.display = '';
|
||||
itemEditButtonObject.innerHTML = editButtonSelected;
|
||||
itemTableNameObject.innerHTML = table;
|
||||
itemRowIdObject.innerHTML = row;
|
||||
itemFieldNameObject.innerHTML = field;
|
||||
itemLineNumberObject.innerHTML = line;
|
||||
// set button and editor line if we have a line number
|
||||
if (typeof line == 'number') {
|
||||
// show and set the save button
|
||||
buttonUpdateItemObject.style.display = '';
|
||||
buttonUpdateItemObject.setAttribute('onclick',"setValueCheck(" + row + ", '" + field + "', '" + table + "');");
|
||||
|
||||
// get top of the code line
|
||||
let top = editorObject.charCoords({line: line, ch: 0}, "local").top;
|
||||
// scroll to the line
|
||||
editorObject.scrollTo(null, top - 12);
|
||||
// select the line
|
||||
editorObject.setCursor(line - 1);
|
||||
} else {
|
||||
// no line so no data we can't save this data
|
||||
buttonUpdateItemObject.setAttribute('onclick', "");
|
||||
buttonUpdateItemObject.style.display = 'none';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to clear item from the editor and hide it
|
||||
*/
|
||||
const clearSelectedItem = async () => {
|
||||
// display area
|
||||
editorObject.setValue('');
|
||||
// clear notice area
|
||||
itemNoticeObject.style.display = 'none';
|
||||
itemEditButtonObject.innerHTML = '...';
|
||||
itemTableNameObject.innerHTML = '...';
|
||||
itemRowIdObject.innerHTML = '...';
|
||||
itemFieldNameObject.innerHTML = '...';
|
||||
itemLineNumberObject.innerHTML = '...';
|
||||
// clear update button
|
||||
buttonUpdateItemObject.setAttribute('onclick', '');
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to clear table items
|
||||
*/
|
||||
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
|
||||
buttonUpdateAllStyleDisplay('none');
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to clear all details of the search
|
||||
*/
|
||||
const clearAll = async () => {
|
||||
// clear all details
|
||||
clearTableItems();
|
||||
clearSelectedItem();
|
||||
searchedObject.innerHTML = '....';
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to clear the search and replace values
|
||||
*/
|
||||
const clearSearch = async () => {
|
||||
// clear the search and replace values
|
||||
searchObject.value = '';
|
||||
replaceObject.value = '';
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to set the search and replace values
|
||||
*/
|
||||
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) {
|
||||
return UrlSearch + table_name +
|
||||
'&search_value=' + urlencode(search) +
|
||||
'&type_search=1&match_case=' + match +
|
||||
'&whole_word=' + whole +
|
||||
'®ex_search=' + regex;
|
||||
} else if (mode == 2) {
|
||||
return UrlSearch + table_name +
|
||||
'&search_value=' + urlencode(search) +
|
||||
'&replace_value=' + urlencode(replace) +
|
||||
'&type_search=2&match_case=' + match +
|
||||
'&whole_word=' + whole +
|
||||
'®ex_search=' + regex;
|
||||
}
|
||||
return UrlSearch + table_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to check if a element has a class
|
||||
*/
|
||||
const hasClass = (elementObject, classNaam) => {
|
||||
return !!elementObject.className.match(new RegExp('(\\s|^)' + classNaam + '(\\s|$)'));
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function add a class from an element
|
||||
*/
|
||||
const addClass = (elementObject, classNaam) => {
|
||||
if (!hasClass(elementObject, classNaam)) {
|
||||
elementObject.className += " " + classNaam;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function remove a class from an element
|
||||
*/
|
||||
const removeClass = (elementObject, classNaam) => {
|
||||
if (hasClass(elementObject, classNaam)) {
|
||||
var reg = new RegExp('(\\s|^)' + classNaam + '(\\s|$)');
|
||||
elementObject.className = elementObject.className.replace(reg, ' ');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to add items to the table
|
||||
*/
|
||||
const addTableItems = async (table, items, typeSearch) => {
|
||||
table.rows.add(items).draw( false );
|
||||
if (typeSearch == 2) {
|
||||
buttonUpdateAllStyleDisplay(''); // TODO should only show once all items are loaded
|
||||
} else {
|
||||
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 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) {
|
||||
// set the searched value
|
||||
replacedObject.innerHTML = htmlentities(replaceValue);
|
||||
} else {
|
||||
replacedObject.innerHTML = '';
|
||||
}
|
||||
// get search value
|
||||
const searchValue = searchObject.value;
|
||||
if (searchValue.length > 2 || (searchValue.length > 0 && forced)) {
|
||||
// Cancel any ongoing requests
|
||||
if (controller) controller.abort();
|
||||
|
||||
// we clear the table again
|
||||
clearAll();
|
||||
|
||||
// set the searched value
|
||||
searchedObject.innerHTML = htmlentities(searchValue);
|
||||
|
||||
// Create new controller and issue new request
|
||||
controller = new AbortController();
|
||||
|
||||
// check if any specific table was set
|
||||
let tables = [];
|
||||
let table = tableObject.value;
|
||||
if (table != -1) {
|
||||
tables.push(table);
|
||||
doSearch(controller.signal, tables);
|
||||
} else {
|
||||
doSearch(controller.signal, searchTables);
|
||||
}
|
||||
} else {
|
||||
// Clear the table
|
||||
clearAll();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
const showSearch = () => {
|
||||
searchSettingsObject.style.display = '';
|
||||
searchDetailsObject.style.display = 'none';
|
||||
replaceDetailsObject.style.display = 'none';
|
||||
tableSearchObject.style.display = 'none';
|
||||
tableLengthObject.style.display = 'none';
|
||||
};
|
||||
|
||||
/**
|
||||
* JS Function to show search settings and hide table search
|
||||
*/
|
||||
const hideSearch = () => {
|
||||
searchSettingsObject.style.display = 'none';
|
||||
searchDetailsObject.style.display = '';
|
||||
tableSearchObject.style.display = '';
|
||||
tableLengthObject.style.display = '';
|
||||
// check if we are in replace mode
|
||||
let mode = modeObject.querySelector('input[type=\'radio\']:checked').value;
|
||||
if (mode == 2) {
|
||||
replaceDetailsObject.style.display = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function htmlentities(string, quoteStyle, charset, doubleEncode) {
|
||||
// discuss at: https://locutus.io/php/htmlentities/
|
||||
// original by: Kevin van Zonneveld (https://kvz.io)
|
||||
// revised by: Kevin van Zonneveld (https://kvz.io)
|
||||
// revised by: Kevin van Zonneveld (https://kvz.io)
|
||||
// improved by: nobbler
|
||||
// improved by: Jack
|
||||
// improved by: Rafał Kukawski (https://blog.kukawski.pl)
|
||||
// improved by: Dj (https://locutus.io/php/htmlentities:425#comment_134018)
|
||||
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
||||
// bugfixed by: Brett Zamir (https://brett-zamir.me)
|
||||
// input by: Ratheous
|
||||
// note 1: function is compatible with PHP 5.2 and older
|
||||
// example 1: htmlentities('Kevin & van Zonneveld')
|
||||
// returns 1: 'Kevin & van Zonneveld'
|
||||
// example 2: htmlentities("foo'bar","ENT_QUOTES")
|
||||
// returns 2: 'foo'bar'
|
||||
const hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle)
|
||||
string = string === null ? '' : string + ''
|
||||
if (!hashMap) {
|
||||
return false
|
||||
}
|
||||
if (quoteStyle && quoteStyle === 'ENT_QUOTES') {
|
||||
hashMap["'"] = '''
|
||||
}
|
||||
doubleEncode = doubleEncode === null || !!doubleEncode
|
||||
const regex = new RegExp('&(?:#\\d+|#x[\\da-f]+|[a-zA-Z][\\da-z]*);|[' +
|
||||
Object.keys(hashMap)
|
||||
.join('')
|
||||
// replace regexp special chars
|
||||
.replace(/([()[\]{}\-.*+?^$|/\\])/g, '\\$1') + ']',
|
||||
'g')
|
||||
return string.replace(regex, function (ent) {
|
||||
if (ent.length > 1) {
|
||||
return doubleEncode ? hashMap['&'] + ent.substr(1) : ent
|
||||
}
|
||||
return hashMap[ent]
|
||||
})
|
||||
}
|
||||
|
||||
function getHtmlTranslationTable(table, quoteStyle) { // eslint-disable-line camelcase
|
||||
// discuss at: https://locutus.io/php/get_html_translation_table/
|
||||
// original by: Philip Peterson
|
||||
// revised by: Kevin van Zonneveld (https://kvz.io)
|
||||
// bugfixed by: noname
|
||||
// bugfixed by: Alex
|
||||
// bugfixed by: Marco
|
||||
// bugfixed by: madipta
|
||||
// bugfixed by: Brett Zamir (https://brett-zamir.me)
|
||||
// bugfixed by: T.Wild
|
||||
// improved by: KELAN
|
||||
// improved by: Brett Zamir (https://brett-zamir.me)
|
||||
// input by: Frank Forte
|
||||
// input by: Ratheous
|
||||
// note 1: It has been decided that we're not going to add global
|
||||
// note 1: dependencies to Locutus, meaning the constants are not
|
||||
// note 1: real constants, but strings instead. Integers are also supported if someone
|
||||
// note 1: chooses to create the constants themselves.
|
||||
// example 1: get_html_translation_table('HTML_SPECIALCHARS')
|
||||
// returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'}
|
||||
|
||||
const entities = {}
|
||||
const hashMap = {}
|
||||
let decimal
|
||||
const constMappingTable = {}
|
||||
const constMappingQuoteStyle = {}
|
||||
let useTable = {}
|
||||
let useQuoteStyle = {}
|
||||
|
||||
// Translate arguments
|
||||
constMappingTable[0] = 'HTML_SPECIALCHARS'
|
||||
constMappingTable[1] = 'HTML_ENTITIES'
|
||||
constMappingQuoteStyle[0] = 'ENT_NOQUOTES'
|
||||
constMappingQuoteStyle[2] = 'ENT_COMPAT'
|
||||
constMappingQuoteStyle[3] = 'ENT_QUOTES'
|
||||
|
||||
useTable = !isNaN(table)
|
||||
? constMappingTable[table]
|
||||
: table
|
||||
? table.toUpperCase()
|
||||
: 'HTML_SPECIALCHARS'
|
||||
|
||||
useQuoteStyle = !isNaN(quoteStyle)
|
||||
? constMappingQuoteStyle[quoteStyle]
|
||||
: quoteStyle
|
||||
? quoteStyle.toUpperCase()
|
||||
: 'ENT_COMPAT'
|
||||
|
||||
if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
|
||||
throw new Error('Table: ' + useTable + ' not supported')
|
||||
}
|
||||
|
||||
entities['38'] = '&'
|
||||
if (useTable === 'HTML_ENTITIES') {
|
||||
entities['160'] = ' '
|
||||
entities['161'] = '¡'
|
||||
entities['162'] = '¢'
|
||||
entities['163'] = '£'
|
||||
entities['164'] = '¤'
|
||||
entities['165'] = '¥'
|
||||
entities['166'] = '¦'
|
||||
entities['167'] = '§'
|
||||
entities['168'] = '¨'
|
||||
entities['169'] = '©'
|
||||
entities['170'] = 'ª'
|
||||
entities['171'] = '«'
|
||||
entities['172'] = '¬'
|
||||
entities['173'] = '­'
|
||||
entities['174'] = '®'
|
||||
entities['175'] = '¯'
|
||||
entities['176'] = '°'
|
||||
entities['177'] = '±'
|
||||
entities['178'] = '²'
|
||||
entities['179'] = '³'
|
||||
entities['180'] = '´'
|
||||
entities['181'] = 'µ'
|
||||
entities['182'] = '¶'
|
||||
entities['183'] = '·'
|
||||
entities['184'] = '¸'
|
||||
entities['185'] = '¹'
|
||||
entities['186'] = 'º'
|
||||
entities['187'] = '»'
|
||||
entities['188'] = '¼'
|
||||
entities['189'] = '½'
|
||||
entities['190'] = '¾'
|
||||
entities['191'] = '¿'
|
||||
entities['192'] = 'À'
|
||||
entities['193'] = 'Á'
|
||||
entities['194'] = 'Â'
|
||||
entities['195'] = 'Ã'
|
||||
entities['196'] = 'Ä'
|
||||
entities['197'] = 'Å'
|
||||
entities['198'] = 'Æ'
|
||||
entities['199'] = 'Ç'
|
||||
entities['200'] = 'È'
|
||||
entities['201'] = 'É'
|
||||
entities['202'] = 'Ê'
|
||||
entities['203'] = 'Ë'
|
||||
entities['204'] = 'Ì'
|
||||
entities['205'] = 'Í'
|
||||
entities['206'] = 'Î'
|
||||
entities['207'] = 'Ï'
|
||||
entities['208'] = 'Ð'
|
||||
entities['209'] = 'Ñ'
|
||||
entities['210'] = 'Ò'
|
||||
entities['211'] = 'Ó'
|
||||
entities['212'] = 'Ô'
|
||||
entities['213'] = 'Õ'
|
||||
entities['214'] = 'Ö'
|
||||
entities['215'] = '×'
|
||||
entities['216'] = 'Ø'
|
||||
entities['217'] = 'Ù'
|
||||
entities['218'] = 'Ú'
|
||||
entities['219'] = 'Û'
|
||||
entities['220'] = 'Ü'
|
||||
entities['221'] = 'Ý'
|
||||
entities['222'] = 'Þ'
|
||||
entities['223'] = 'ß'
|
||||
entities['224'] = 'à'
|
||||
entities['225'] = 'á'
|
||||
entities['226'] = 'â'
|
||||
entities['227'] = 'ã'
|
||||
entities['228'] = 'ä'
|
||||
entities['229'] = 'å'
|
||||
entities['230'] = 'æ'
|
||||
entities['231'] = 'ç'
|
||||
entities['232'] = 'è'
|
||||
entities['233'] = 'é'
|
||||
entities['234'] = 'ê'
|
||||
entities['235'] = 'ë'
|
||||
entities['236'] = 'ì'
|
||||
entities['237'] = 'í'
|
||||
entities['238'] = 'î'
|
||||
entities['239'] = 'ï'
|
||||
entities['240'] = 'ð'
|
||||
entities['241'] = 'ñ'
|
||||
entities['242'] = 'ò'
|
||||
entities['243'] = 'ó'
|
||||
entities['244'] = 'ô'
|
||||
entities['245'] = 'õ'
|
||||
entities['246'] = 'ö'
|
||||
entities['247'] = '÷'
|
||||
entities['248'] = 'ø'
|
||||
entities['249'] = 'ù'
|
||||
entities['250'] = 'ú'
|
||||
entities['251'] = 'û'
|
||||
entities['252'] = 'ü'
|
||||
entities['253'] = 'ý'
|
||||
entities['254'] = 'þ'
|
||||
entities['255'] = 'ÿ'
|
||||
}
|
||||
|
||||
if (useQuoteStyle !== 'ENT_NOQUOTES') {
|
||||
entities['34'] = '"'
|
||||
}
|
||||
if (useQuoteStyle === 'ENT_QUOTES') {
|
||||
entities['39'] = '''
|
||||
}
|
||||
entities['60'] = '<'
|
||||
entities['62'] = '>'
|
||||
|
||||
// ascii decimals to real symbols
|
||||
for (decimal in entities) {
|
||||
if (entities.hasOwnProperty(decimal)) {
|
||||
hashMap[String.fromCharCode(decimal)] = entities[decimal]
|
||||
}
|
||||
}
|
||||
|
||||
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, '+')
|
||||
}
|
@ -67,8 +67,11 @@ class ComponentbuilderControllerAjax extends BaseController
|
||||
$this->registerTask('fieldTypeProperties', 'ajax');
|
||||
$this->registerTask('getFieldPropertyDesc', 'ajax');
|
||||
$this->registerTask('getCodeGlueOptions', 'ajax');
|
||||
$this->registerTask('searchTable', 'ajax');
|
||||
$this->registerTask('updateTable', 'ajax');
|
||||
$this->registerTask('doSearch', 'ajax');
|
||||
$this->registerTask('replaceAll', 'ajax');
|
||||
$this->registerTask('getSearchValue', 'ajax');
|
||||
$this->registerTask('getReplaceValue', 'ajax');
|
||||
$this->registerTask('setValue', 'ajax');
|
||||
$this->registerTask('snippetDetails', 'ajax');
|
||||
$this->registerTask('setSnippetGithub', 'ajax');
|
||||
$this->registerTask('getSnippets', 'ajax');
|
||||
@ -1633,18 +1636,19 @@ class ComponentbuilderControllerAjax extends BaseController
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'searchTable':
|
||||
case 'doSearch':
|
||||
try
|
||||
{
|
||||
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
|
||||
$type_searchValue = $jinput->get('type_search', 1, 'INT');
|
||||
$search_valueValue = $jinput->get('search_value', NULL, 'RAW');
|
||||
$match_caseValue = $jinput->get('match_case', 0, 'INT');
|
||||
$whole_wordValue = $jinput->get('whole_word', 0, 'INT');
|
||||
$regex_searchValue = $jinput->get('regex_search', 0, 'INT');
|
||||
$component_idValue = $jinput->get('component_id', 0, 'INT');
|
||||
if($table_nameValue && $user->id != 0 && $search_valueValue)
|
||||
if($table_nameValue && $user->id != 0 && $type_searchValue && $search_valueValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->searchTable($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
|
||||
$result = $this->getModel('ajax')->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1679,7 +1683,7 @@ class ComponentbuilderControllerAjax extends BaseController
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'updateTable':
|
||||
case 'replaceAll':
|
||||
try
|
||||
{
|
||||
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
|
||||
@ -1691,7 +1695,148 @@ class ComponentbuilderControllerAjax extends BaseController
|
||||
$component_idValue = $jinput->get('component_id', 0, 'INT');
|
||||
if($table_nameValue && $user->id != 0 && $search_valueValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->updateTable($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
|
||||
$result = $this->getModel('ajax')->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback)
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($e);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getSearchValue':
|
||||
try
|
||||
{
|
||||
$field_nameValue = $jinput->get('field_name', NULL, 'WORD');
|
||||
$row_idValue = $jinput->get('row_id', NULL, 'INT');
|
||||
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
|
||||
$search_valueValue = $jinput->get('search_value', NULL, 'RAW');
|
||||
$replace_valueValue = $jinput->get('replace_value', NULL, 'RAW');
|
||||
$match_caseValue = $jinput->get('match_case', 0, 'INT');
|
||||
$whole_wordValue = $jinput->get('whole_word', 0, 'INT');
|
||||
$regex_searchValue = $jinput->get('regex_search', 0, 'INT');
|
||||
if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback)
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($e);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getReplaceValue':
|
||||
try
|
||||
{
|
||||
$field_nameValue = $jinput->get('field_name', NULL, 'WORD');
|
||||
$row_idValue = $jinput->get('row_id', NULL, 'INT');
|
||||
$line_nrValue = $jinput->get('line_nr', 0, 'STRING');
|
||||
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
|
||||
$search_valueValue = $jinput->get('search_value', NULL, 'RAW');
|
||||
$replace_valueValue = $jinput->get('replace_value', NULL, 'RAW');
|
||||
$match_caseValue = $jinput->get('match_case', 0, 'INT');
|
||||
$whole_wordValue = $jinput->get('whole_word', 0, 'INT');
|
||||
$regex_searchValue = $jinput->get('regex_search', 0, 'INT');
|
||||
if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getReplaceValue($field_nameValue, $row_idValue, $line_nrValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback)
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($e);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'setValue':
|
||||
try
|
||||
{
|
||||
$valueValue = $jinput->get('value', NULL, 'RAW');
|
||||
$row_idValue = $jinput->get('row_id', NULL, 'INT');
|
||||
$field_nameValue = $jinput->get('field_name', NULL, 'WORD');
|
||||
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
|
||||
if($valueValue && $user->id != 0 && $row_idValue && $field_nameValue && $table_nameValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->setValue($valueValue, $row_idValue, $field_nameValue, $table_nameValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
public function getCompilerAnimations()
|
||||
public function getDynamicContent()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
@ -65,7 +65,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
{
|
||||
// get the model
|
||||
$model = $this->getModel('compiler');
|
||||
if ($model->getCompilerAnimations($message))
|
||||
if ($model->getDynamicContent($message))
|
||||
{
|
||||
$message = JText::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB');
|
||||
$this->setRedirect($redirect_url, $message, 'message');
|
||||
@ -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']);
|
||||
|
@ -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,13 +618,15 @@ 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'))
|
||||
@ -640,28 +634,28 @@ class Compiler extends Infusion
|
||||
$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 :)
|
||||
@ -672,13 +666,13 @@ class Compiler extends Infusion
|
||||
// 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 +684,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(
|
||||
$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)
|
||||
@ -746,9 +739,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)
|
||||
@ -787,7 +780,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 +798,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 +847,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 +895,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 +938,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 +955,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 +975,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 +997,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 +1023,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 +1032,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(
|
||||
$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 +1078,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)
|
||||
@ -1240,7 +1163,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 +1172,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)
|
||||
@ -1334,7 +1257,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 +1281,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 +1385,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 +1470,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 +1504,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
@ -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
|
||||
@ -56,6 +65,7 @@ spl_autoload_register(function ($class) {
|
||||
}
|
||||
});
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Language\Language;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
@ -63,9 +73,8 @@ use Joomla\Utilities\ArrayHelper;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use Joomla\Archive\Archive;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\Archive\Archive;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\CMS\Filesystem\Path;
|
||||
use VDM\Joomla\Utilities;
|
||||
|
||||
@ -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');
|
||||
|
@ -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 '';
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -1,7 +0,0 @@
|
||||
in
|
||||
public
|
||||
extends
|
||||
private
|
||||
protected
|
||||
implements
|
||||
instanceof
|
@ -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
|
@ -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
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
+
|
||||
-
|
||||
*
|
||||
/
|
||||
%
|
||||
=
|
||||
+=
|
||||
-=
|
||||
*=
|
||||
/=
|
||||
%=
|
||||
<<=
|
||||
>>=
|
||||
>>>=
|
||||
&=
|
||||
^=
|
||||
|=
|
||||
&
|
||||
|
|
||||
^
|
||||
~
|
||||
<<
|
||||
>>
|
||||
>>>
|
||||
==
|
||||
===
|
||||
!=
|
||||
!==
|
||||
>
|
||||
<
|
||||
>=
|
||||
<=
|
||||
&&
|
||||
||
|
||||
.
|
||||
[
|
||||
]
|
||||
?
|
||||
:
|
||||
,
|
||||
;
|
||||
(
|
||||
)
|
||||
{
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
+
|
||||
-
|
||||
*
|
||||
/
|
||||
%
|
||||
=
|
||||
+=
|
||||
-=
|
||||
*=
|
||||
/=
|
||||
%=
|
||||
<<=
|
||||
>>=
|
||||
>>>=
|
||||
&=
|
||||
^=
|
||||
|=
|
||||
&
|
||||
|
|
||||
^
|
||||
~
|
||||
<<
|
||||
>>
|
||||
>>>
|
||||
==
|
||||
===
|
||||
!=
|
||||
!==
|
||||
>
|
||||
<
|
||||
>=
|
||||
<=
|
||||
&&
|
||||
||
|
||||
!
|
||||
.
|
||||
[
|
||||
?
|
||||
:
|
||||
,
|
||||
;
|
||||
(
|
||||
{
|
@ -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"
|
||||
@ -1302,6 +1300,7 @@ COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another
|
||||
COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO="Already translated into"
|
||||
COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add"
|
||||
COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB_A_SFIND_OUT_WHYA="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. <small>(Make <b>SURE</b> to move this zipped backup package out of the tmp folder before doing an import)</small><br />If you are importing a package of a 3rd party JCB package developer, <b>make sure it is a reputable JCB package developers!</b> <a %s>Find out why!</a>"
|
||||
COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN="and finished the search in"
|
||||
COM_COMPONENTBUILDER_ANY_LANGUAGE="Any language"
|
||||
COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)"
|
||||
COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED="An error has occurred"
|
||||
@ -1312,12 +1311,14 @@ COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE="Are you sure you w
|
||||
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET="Are you sure you would like to replace your local snippet with this JCB community snippet?"
|
||||
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET="Are you sure you would like to update your local snippet with this newer JCB community snippet?"
|
||||
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET="Are you sure you would like to update your local snippet with this older JCB community snippet?"
|
||||
COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE="Are you therefore absolutely sure you want to continue?"
|
||||
COM_COMPONENTBUILDER_AUTHOR="Author"
|
||||
COM_COMPONENTBUILDER_AUTHOR_EMAIL="Author Email"
|
||||
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"
|
||||
@ -1331,6 +1332,7 @@ 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_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"
|
||||
@ -1650,6 +1652,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!"
|
||||
@ -1721,6 +1724,7 @@ COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_N_ITEMS_UNFEATURED="%s Components Ad
|
||||
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_N_ITEMS_UNFEATURED_1="%s Component Admin Views unfeatured."
|
||||
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_N_ITEMS_UNPUBLISHED="%s Components Admin Views unpublished."
|
||||
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_N_ITEMS_UNPUBLISHED_1="%s Component Admin Views unpublished."
|
||||
COM_COMPONENTBUILDER_COMPONENTS_BR_SMALLDISABLED_SOONSMALL="Components <br /><small>(disabled... soon!)</small>"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_CONFIG="Components Config"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_CONFIG_ACCESS="Components Config Access"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_CONFIG_ACCESS_DESC="Allows the users in this group to access access components config"
|
||||
@ -3686,8 +3690,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"
|
||||
@ -4352,10 +4354,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 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 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 Dynamic Get<br /><br />"
|
||||
@ -4376,9 +4376,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 Site View<br /><br />"
|
||||
COM_COMPONENTBUILDER_DASHBOARD_SNIPPETS="Snippets<br /><br />"
|
||||
COM_COMPONENTBUILDER_DASHBOARD_TEMPLATES="Templates<br /><br />"
|
||||
COM_COMPONENTBUILDER_DASHBOARD_TEMPLATE_ADD="Add Template<br /><br />"
|
||||
@ -4704,6 +4704,7 @@ COM_COMPONENTBUILDER_EDIT_CREATED_DATE="Edit Created Date"
|
||||
COM_COMPONENTBUILDER_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date."
|
||||
COM_COMPONENTBUILDER_EDIT_S="Edit %s"
|
||||
COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s"
|
||||
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"
|
||||
@ -4717,6 +4718,8 @@ COM_COMPONENTBUILDER_EMLICENSEEM_BSB="<em>License:</em> <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_EMOWNEREM_BSB="<em>Owner:</em> <b>%s</b>"
|
||||
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"
|
||||
COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT="Enter your search text"
|
||||
COM_COMPONENTBUILDER_EQUAL="Equal"
|
||||
COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_AND_YOUR_LOCAL_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_THE_SAME_BCREATIONB_AND_BMODIFIED_DATEB="Equal means that the community snippet (with the same name, library and type) and your local snippet (with the same name, library and type) has the same <b>creation</b> and <b>modified date</b>."
|
||||
COM_COMPONENTBUILDER_ERROR="Error"
|
||||
@ -4789,6 +4792,7 @@ COM_COMPONENTBUILDER_FIELDS_N_ITEMS_UNPUBLISHED="%s Fields unpublished."
|
||||
COM_COMPONENTBUILDER_FIELDS_N_ITEMS_UNPUBLISHED_1="%s Field unpublished."
|
||||
COM_COMPONENTBUILDER_FIELDS_SUBMENU="Fields Submenu"
|
||||
COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC="Allows the users in this group to submenu of field"
|
||||
COM_COMPONENTBUILDER_FIELDS_THAT_HAD="fields that had"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE="Fieldtype"
|
||||
COM_COMPONENTBUILDER_FIELDTYPES="Fieldtypes"
|
||||
COM_COMPONENTBUILDER_FIELDTYPES_ACCESS="Fieldtypes Access"
|
||||
@ -5030,6 +5034,7 @@ $mediumkey = ComponentbuilderHelper::getCryptKey('medium');
|
||||
$medium = new FOFEncryptAes($mediumkey);"
|
||||
COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL_LABEL="Initiator<br /><small>on save model</small>"
|
||||
COM_COMPONENTBUILDER_FIELD_INT="INT"
|
||||
COM_COMPONENTBUILDER_FIELD_IN_THE="field in the"
|
||||
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER_DESCRIPTION="Add JavaScript for the list view that is loaded in the footer inside script tags. Do not add the script tags."
|
||||
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER_LABEL="Javascript (list view footer)"
|
||||
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION="Add JavaScript for the edit view that is loaded in the footer inside script tags. Do not add the script tags."
|
||||
@ -5444,6 +5449,8 @@ COM_COMPONENTBUILDER_FOLDER_BSB_WAS_MOVED_TO_BSB="Folder <b>%s</b> was moved to
|
||||
COM_COMPONENTBUILDER_FOLDER_BSB_WAS_NOT_MOVED_TO_BSB="Folder <b>%s</b> was not moved to <b>%s</b>"
|
||||
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_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."
|
||||
@ -5487,6 +5494,7 @@ COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder w
|
||||
COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!"
|
||||
COM_COMPONENTBUILDER_GROUP="group"
|
||||
COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata"
|
||||
COM_COMPONENTBUILDER_HEADERS="Headers"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access"
|
||||
@ -5587,6 +5595,8 @@ 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_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."
|
||||
COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP="<h4 class="nav-header">Copyright</h4><p>%s</p>"
|
||||
COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP="<h4 class="nav-header">License</h4><p>%s</p>"
|
||||
COM_COMPONENTBUILDER_HI="Hi"
|
||||
@ -5594,9 +5604,11 @@ 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_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_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>"
|
||||
@ -5609,6 +5621,7 @@ COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_PACKAGEHTWOTHIS_COULD_BE_DUE_TO_T
|
||||
COM_COMPONENTBUILDER_IAUTHORI_BSB="<i>Author:</i> <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_ICOMPANYI_BSB="<i>Company:</i> <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_ICON="Icon"
|
||||
COM_COMPONENTBUILDER_ID="id"
|
||||
COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET="ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set."
|
||||
COM_COMPONENTBUILDER_IEMAILI_BSB="<i>Email:</i> <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_IMPORT_BY_GUID_ONLY="Import by GUID only!"
|
||||
@ -5675,6 +5688,7 @@ COM_COMPONENTBUILDER_ISOLATE="Isolate"
|
||||
COM_COMPONENTBUILDER_IS_BEING_COMPILED="is being compiled"
|
||||
COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/radio/checkboxes)"
|
||||
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_COMMUNITY="JCB Community"
|
||||
COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
|
||||
@ -5987,7 +6001,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 />
|
||||
@ -6012,7 +6026,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 />
|
||||
@ -7738,6 +7752,8 @@ COM_COMPONENTBUILDER_LIBRARY_VERSION_DESC="A count of the number of times this L
|
||||
COM_COMPONENTBUILDER_LIBRARY_VERSION_LABEL="Version"
|
||||
COM_COMPONENTBUILDER_LICENSE="License"
|
||||
COM_COMPONENTBUILDER_LICENSE_S="License: %s"
|
||||
COM_COMPONENTBUILDER_LINE="line"
|
||||
COM_COMPONENTBUILDER_LINES="lines"
|
||||
COM_COMPONENTBUILDER_LINK="Link"
|
||||
COM_COMPONENTBUILDER_LINK_LOCAL_DYNAMIC="Link & Local (dynamic)"
|
||||
COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor"
|
||||
@ -7749,6 +7765,7 @@ COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"
|
||||
COM_COMPONENTBUILDER_LOCAL_SNIPPET="Local snippet"
|
||||
COM_COMPONENTBUILDER_MAIN_MENU="Main Menu"
|
||||
COM_COMPONENTBUILDER_MATCH_BEHAVIOUR="Match Behaviour"
|
||||
COM_COMPONENTBUILDER_MATCH_CASE="Match Case"
|
||||
COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
|
||||
COM_COMPONENTBUILDER_MATCH_OPTIONS="Match Options"
|
||||
COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_field)"
|
||||
@ -7756,6 +7773,7 @@ COM_COMPONENTBUILDER_MERGE="Merge"
|
||||
COM_COMPONENTBUILDER_METHODS="Methods"
|
||||
COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript"
|
||||
COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
|
||||
COM_COMPONENTBUILDER_MODE="Mode"
|
||||
COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)"
|
||||
COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)"
|
||||
COM_COMPONENTBUILDER_MODULE="Module"
|
||||
@ -7790,7 +7808,7 @@ COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cr
|
||||
COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found."
|
||||
COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked"
|
||||
COM_COMPONENTBUILDER_NO_FOUND="No Found"
|
||||
COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S="No instances where found %s"
|
||||
COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S="No instances where found in %s"
|
||||
COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found"
|
||||
COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
|
||||
COM_COMPONENTBUILDER_NO_LANGUAGES_FOUND="No Languages Found"
|
||||
@ -7997,13 +8015,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."
|
||||
@ -8121,7 +8155,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."
|
||||
@ -8141,9 +8177,13 @@ COM_COMPONENTBUILDER_PUBLISHING="Publishing"
|
||||
COM_COMPONENTBUILDER_README="Readme"
|
||||
COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component"
|
||||
COM_COMPONENTBUILDER_REFRESH="Refresh"
|
||||
COM_COMPONENTBUILDER_REGEX_SEARCH="Regex Search"
|
||||
COM_COMPONENTBUILDER_REMOVE="Remove"
|
||||
COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL="Removing all zip packages from the temporary folder of the Joomla install"
|
||||
COM_COMPONENTBUILDER_RENAME="Rename"
|
||||
COM_COMPONENTBUILDER_REPLACE="Replace"
|
||||
COM_COMPONENTBUILDER_REPLACED_WITH="replaced with"
|
||||
COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE="replace process complete"
|
||||
COM_COMPONENTBUILDER_REPORT_AN_ISSUE_BSB="Report an issue: <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_ENTERED_BE_ONE_OF_THE_OPTIONS_IN_AN_ELEMENT_OF_TYPEQUOTLISTQUOT_THAT_IS_THAT_THE_ELEMENT_IS_A_SELECT_LIST="Requires the value entered be one of the options in an element of type="list": that is, that the element is a select list."
|
||||
COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_A_TELEPHONE_NUMBER_COMPLYING_WITH_THE_STANDARDS_OF_NANPA_ITUT_TRECEONE_HUNDRED_AND_SIXTY_FOUR_OR_IETF_RFCFOUR_THOUSAND_NINE_HUNDRED_AND_THIRTY_THREE="Requires the value to be a Telephone number complying with the standards of nanpa, ITU-T T-REC-E.164 or ietf rfc4933."
|
||||
@ -8152,18 +8192,27 @@ COM_COMPONENTBUILDER_REVERT_ALL_AHEAD_SNIPPETS="Revert All Ahead Snippets"
|
||||
COM_COMPONENTBUILDER_RIGHT_IN_TAB="Right in Tab"
|
||||
COM_COMPONENTBUILDER_RIGHT_OF_TABS="Right of Tabs"
|
||||
COM_COMPONENTBUILDER_RUN_EXPANSION="Run Expansion"
|
||||
COM_COMPONENTBUILDER_SAVE_ALL_CHANGES_MADE_TO_THE_SELECTED_ITEM="Save all changes made to the selected item."
|
||||
COM_COMPONENTBUILDER_SAVE_ITEM="Save Item"
|
||||
COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved."
|
||||
COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another."
|
||||
COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s<br />You can add a <b>gitHub Access Token</b> to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s."
|
||||
COM_COMPONENTBUILDER_SEARCH="Search"
|
||||
COM_COMPONENTBUILDER_SEARCHABLE="Searchable"
|
||||
COM_COMPONENTBUILDER_SEARCHED_FOR="searched for"
|
||||
COM_COMPONENTBUILDER_SEARCHING="searching"
|
||||
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"
|
||||
COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu"
|
||||
COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search"
|
||||
COM_COMPONENTBUILDER_SECONDS="seconds"
|
||||
COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info"
|
||||
COM_COMPONENTBUILDER_SELECTION="selection"
|
||||
COM_COMPONENTBUILDER_SELECT_ADMIN_VIEW="Select Admin View"
|
||||
@ -8175,8 +8224,10 @@ COM_COMPONENTBUILDER_SELECT_A_SNIPPET="select a snippet"
|
||||
COM_COMPONENTBUILDER_SELECT_COMPONENT="Select Component"
|
||||
COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension"
|
||||
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile"
|
||||
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_SEARCH="Select the component to search"
|
||||
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_YOUR_WOULD_LIKE_TO_IMPORT="Select the component your would like to import."
|
||||
COM_COMPONENTBUILDER_SELECT_THE_PACKAGE_TO_IMPORT="Select the package to import"
|
||||
COM_COMPONENTBUILDER_SELECT_THE_TABLE_TO_SEARCH="Select the table to search"
|
||||
COM_COMPONENTBUILDER_SERVER="Server"
|
||||
COM_COMPONENTBUILDER_SERVERS="Servers"
|
||||
COM_COMPONENTBUILDER_SERVERS_ACCESS="Servers Access"
|
||||
@ -8317,6 +8368,7 @@ COM_COMPONENTBUILDER_SERVER_VERSION_DESC="A count of the number of times this Se
|
||||
COM_COMPONENTBUILDER_SERVER_VERSION_LABEL="Version"
|
||||
COM_COMPONENTBUILDER_SET_A_CLASS_VALUE_FOR_THE_LIST_VIEW_OF_THIS_FIELD="Set a class value for the list view of this field."
|
||||
COM_COMPONENTBUILDER_SET_CUSTOM="Set Custom"
|
||||
COM_COMPONENTBUILDER_SET_THE_SEARCH_BEHAVIOUR_HERE="Set the search behaviour here."
|
||||
COM_COMPONENTBUILDER_SHARE_SNIPPETS="Share Snippets"
|
||||
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="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."
|
||||
COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
|
||||
@ -8342,8 +8394,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"
|
||||
@ -8962,6 +9012,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"
|
||||
@ -9000,6 +9052,9 @@ COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS
|
||||
COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected a change in <b>EXTERNALCODE</b>, but you do not have permission to allow this change so <b>%s</b> was removed from the compilation. Please contact your system administrator for more info!<br /><small>(admin access required)</small>"
|
||||
COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected <b>NEW EXTERNALCODE</b>, but you do not have permission to allow this new code/string so <b>%s</b> was removed from the compilation. Please contact you system administrator for more info!<br /><small>(admin access required)</small>"
|
||||
COM_COMPONENTBUILDER_TAB="Tab"
|
||||
COM_COMPONENTBUILDER_TABLE="Table"
|
||||
COM_COMPONENTBUILDER_TABLES="Tables"
|
||||
COM_COMPONENTBUILDER_TABLES_WITH="tables with"
|
||||
COM_COMPONENTBUILDER_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_PLEASE_UPDATE_YOUR_JCB_INSTALL_AND_TRY_AGAIN="Table <b>%s</b> not found in the local database so its values could not be imported, please update your JCB install and try again."
|
||||
COM_COMPONENTBUILDER_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_THE_WHOLE_POWERS_FEATURE_IS_ONLY_AVAILABLE_TO_A_HREFSPRO_MEMBERSA_AT_THIS_TIME="Table <b>%s</b> not found in the local database so its values could not be imported. The whole powers feature is only available to <a href=%s>PRO Members</a> at this time."
|
||||
COM_COMPONENTBUILDER_TARGET_BEHAVIOUR="Target Behaviour"
|
||||
@ -9186,7 +9241,9 @@ COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="T
|
||||
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
|
||||
COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING="The pro board is loading"
|
||||
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
|
||||
COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE="The replace process had an error with table"
|
||||
COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected."
|
||||
COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE="The search process had an error with table"
|
||||
COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED="The server details for <b>(ID: %s)</b> could not be retrieved!"
|
||||
COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED="The Snippets Were Successfully Exported!"
|
||||
COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED="The Snippet Was Successfully Exported!"
|
||||
@ -9197,6 +9254,8 @@ COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_
|
||||
COM_COMPONENTBUILDER_THE_WIKI_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION="The wiki can only be loaded when your JCB system has internet connection."
|
||||
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
|
||||
COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_OTHER_AREAS_OF_JCB_AT_THIS_TIME="This <b>%s</b> is not linked to any other areas of JCB at this time!"
|
||||
COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="This can not be undone, are you sure you want to continue?"
|
||||
COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB="This can not be undone, <b>you have been warned</b>!"
|
||||
COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT="This may take a while depending on the size of your project."
|
||||
COM_COMPONENTBUILDER_THIS_PACKAGE_BPASSEDB_THE_CHECKSUM_VALIDATIONBR_BR_SMALLMANUALLY_ALSO_VALIDATE_THAT_THE_CORRECT_CHECKSUM_WAS_USEDSMALLBR_THIS_CHECKSUM_BSB_MUST_BE_THE_SAME_AS_THE_ONE_FOUND_A_S_SA="This package <b>PASSED</b> the checksum validation!<br /><br /><small>Manually also validate that the correct checksum was used.</small><br />This checksum: <b>%s</b> must be the same as the one found @ <a %s %s</a>"
|
||||
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
|
||||
@ -9272,7 +9331,9 @@ COM_COMPONENTBUILDER_TYPE_VALIDATION_RULE="Validation Rule"
|
||||
COM_COMPONENTBUILDER_UNACTIVE_ONLY_FOUR_TEXT_FIELD="Unactive (only 4 text_field)"
|
||||
COM_COMPONENTBUILDER_UNDERNEATH_TABS="Underneath Tabs"
|
||||
COM_COMPONENTBUILDER_UPDATE="Update"
|
||||
COM_COMPONENTBUILDER_UPDATE_ALL="Update All"
|
||||
COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets"
|
||||
COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE="Update all items found with this database search, with the replace value."
|
||||
COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets"
|
||||
COM_COMPONENTBUILDER_UP_TO_DATE="Up to date"
|
||||
COM_COMPONENTBUILDER_USAGE="Usage"
|
||||
@ -9388,8 +9449,15 @@ COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEA
|
||||
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_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_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH="Would you like to do a reverse search?"
|
||||
COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH="Would you like to repeat the same search?"
|
||||
COM_COMPONENTBUILDER_YES="Yes"
|
||||
COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL"
|
||||
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_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."
|
||||
@ -9418,9 +9486,11 @@ 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"
|
||||
COM_COMPONENTBUILDER__SEARCH_ALL_="- Search All -"
|
||||
COM_COMPONENTBUILDER__SELECT_COMPONENT_="- Select Component -"
|
||||
COM_COMPONENTBUILDER__SELECT_PACKAGE_="- Select Package -"
|
||||
COM_COMPONENTBUILDER__SINCE_YOU_DONT_HAVE_PERMISSION_TO_CREATE_S=", since you don't have permission to create %s!"
|
||||
|
@ -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"
|
||||
|
45
admin/layouts/power/composer_fullwidth.php
Normal file
45
admin/layouts/power/composer_fullwidth.php
Normal 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; ?>
|
43
admin/layouts/rows.php
Normal file
43
admin/layouts/rows.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?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');
|
||||
|
||||
$headers = $displayData['headers'];
|
||||
$items = $displayData['items'];
|
||||
|
||||
?>
|
||||
<?php if (is_array($items)): ?>
|
||||
<?php foreach ($items as $row => $values): ?>
|
||||
<tr>
|
||||
<?php foreach($values as $value): ?>
|
||||
<td class=""><?php echo $value; ?></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php elseif (is_numeric($items) && is_array($headers)): ?>
|
||||
<?php for( $row = 0; $row < $items; $row++): ?>
|
||||
<tr class="">
|
||||
<?php foreach($headers as $header): ?>
|
||||
<td class=""> </td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
<?php elseif (is_numeric($items) && is_numeric($headers)): ?>
|
||||
<?php for( $row = 0; $row < $items; $row++): ?>
|
||||
<tr class="">
|
||||
<?php for( $column = 0; $column < $headers; $column++): ?>
|
||||
<td class=""> </td>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
<?php endif; ?>
|
72
admin/layouts/table.php
Normal file
72
admin/layouts/table.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?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');
|
||||
|
||||
$table_id = (isset($displayData['id'])) ? $displayData['id'] : ComponentbuilderHelper::randomkey(7);
|
||||
$name = (isset($displayData['name'])) ? $displayData['name'] : false;
|
||||
$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [JText::_('COM_COMPONENTBUILDER_NO'), JText::_('COM_COMPONENTBUILDER_HEADERS'), JText::_('COM_COMPONENTBUILDER_FOUND')];
|
||||
$items = (isset($displayData['items'])) ? $displayData['items'] : 6;
|
||||
|
||||
?>
|
||||
<div class="uk-overflow-auto">
|
||||
<table id="<?php echo $table_id; ?>" class="uk-table">
|
||||
<thead>
|
||||
<?php if (is_array($headers)): ?>
|
||||
<?php if ($name): ?>
|
||||
<tr>
|
||||
<th colspan="<?php echo count($headers); ?>" style="text-align:center"><b><?php echo $name; ?></b></th>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<?php foreach($headers as $code_name => $header): ?>
|
||||
<?php
|
||||
if (is_numeric($code_name))
|
||||
{
|
||||
$code_name = ComponentbuilderHelper::safeString($header);
|
||||
}
|
||||
?>
|
||||
<th data-name="<?php echo $code_name; ?>"><?php echo $header; ?></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php elseif (is_numeric($headers)): ?>
|
||||
<?php if ($name): ?>
|
||||
<tr>
|
||||
<th colspan="<?php echo (int) $headers; ?>" style="text-align:center"><b><?php echo $name; ?></b></th>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr style="position: absolute; top: -9999px; left: -9999px;">
|
||||
<?php for( $row = 0; $row < $headers; $row++): ?>
|
||||
<th><?php echo ComponentbuilderHelper::safeString($row); ?></th>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php echo JLayoutHelper::render('rows', ['headers' => $headers, 'items' => $items]); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
// Initialize the table if [init is not set], or [is true]
|
||||
// To stop initialization set $displayData['init'] = false;
|
||||
if (!isset($displayData['init']) || $displayData['init']) :
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
var <?php echo $table_id; ?> = jQuery('#<?php echo $table_id; ?>').DataTable({
|
||||
paging: false,
|
||||
select: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
@ -14,7 +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 VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
|
||||
|
||||
/**
|
||||
@ -3609,6 +3610,7 @@ class ComponentbuilderModelAjax extends ListModel
|
||||
* Search for value in a table
|
||||
*
|
||||
* @param string $tableName The main table to search
|
||||
* @param int $typeSearch The type of search being done
|
||||
* @param string $searchValue The value to search for
|
||||
* @param int $matchCase The switch to control match case
|
||||
* @param int $wholeWord The switch to control whole word
|
||||
@ -3618,26 +3620,43 @@ class ComponentbuilderModelAjax extends ListModel
|
||||
* @return array|null
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function searchTable(string $tableName, string $searchValue,
|
||||
public function doSearch(string $tableName, int $typeSearch, string $searchValue,
|
||||
int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array
|
||||
{
|
||||
// check if this is a valid table
|
||||
if (SearchFactory::_('Table')->exist($tableName))
|
||||
{
|
||||
// load the configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->match_case = $matchCase;
|
||||
SearchFactory::_('Config')->whole_word = $wholeWord;
|
||||
SearchFactory::_('Config')->regex_search = $regexSearch;
|
||||
SearchFactory::_('Config')->component_id = $componentId;
|
||||
|
||||
if (($items = SearchFactory::_('Agent')->find()) !== null)
|
||||
try
|
||||
{
|
||||
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items];
|
||||
}
|
||||
// load the configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->type_search = $typeSearch;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->match_case = $matchCase;
|
||||
SearchFactory::_('Config')->whole_word = $wholeWord;
|
||||
SearchFactory::_('Config')->regex_search = $regexSearch;
|
||||
SearchFactory::_('Config')->component_id = $componentId;
|
||||
|
||||
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S', $tableName)];
|
||||
if (($items = SearchFactory::_('Agent')->table($tableName)) !== null)
|
||||
{
|
||||
return [
|
||||
'success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName),
|
||||
'items' => $items,
|
||||
'fields_count' => SearchFactory::_('Config')->field_counter,
|
||||
'line_count' => SearchFactory::_('Config')->line_counter
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'not_found' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S', $tableName),
|
||||
'fields_count' => SearchFactory::_('Config')->field_counter,
|
||||
'line_count' => SearchFactory::_('Config')->line_counter
|
||||
];
|
||||
}
|
||||
catch(Exception $error)
|
||||
{
|
||||
return ['error' => $error->getMessage()];
|
||||
}
|
||||
}
|
||||
|
||||
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
|
||||
@ -3648,33 +3667,159 @@ class ComponentbuilderModelAjax extends ListModel
|
||||
*
|
||||
* @param string $tableName The main table to search
|
||||
* @param string $searchValue The value to search for
|
||||
* @param string|null $replaceValue The value to replace search value
|
||||
* @param int $matchCase The switch to control match case
|
||||
* @param int $wholeWord The switch to control whole word
|
||||
* @param int $regexSearch The switch to control regex search
|
||||
* @param int $componentId The option to filter by component
|
||||
* @param string|null $replaceValue The value to replace search value
|
||||
* @param int $matchCase The switch to control match case
|
||||
* @param int $wholeWord The switch to control whole word
|
||||
* @param int $regexSearch The switch to control regex search
|
||||
* @param int $componentId The option to filter by component
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function updateTable(string $tableName, string $searchValue, ?string $replaceValue = null,
|
||||
public function replaceAll(string $tableName, string $searchValue, ?string $replaceValue = null,
|
||||
int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array
|
||||
{
|
||||
// check if this is a valid table
|
||||
if (SearchFactory('Table')->exist($tableName))
|
||||
if (SearchFactory::_('Table')->exist($tableName))
|
||||
{
|
||||
// load the configurations
|
||||
SearchFactory('Config')->table_name = $tableName;
|
||||
SearchFactory('Config')->search_value = $searchValue;
|
||||
SearchFactory('Config')->replace_value = $replaceValue;
|
||||
SearchFactory('Config')->match_case = $matchCase;
|
||||
SearchFactory('Config')->whole_word = $wholeWord;
|
||||
SearchFactory('Config')->regex_search = $regexSearch;
|
||||
SearchFactory('Config')->component_id = $componentId;
|
||||
try
|
||||
{
|
||||
// load the configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->replace_value = $replaceValue;
|
||||
SearchFactory::_('Config')->match_case = $matchCase;
|
||||
SearchFactory::_('Config')->whole_word = $wholeWord;
|
||||
SearchFactory::_('Config')->regex_search = $regexSearch;
|
||||
SearchFactory::_('Config')->component_id = $componentId;
|
||||
|
||||
SearchFactory('Agent')->replace();
|
||||
if (($number = SearchFactory::_('Agent')->replace()) !== 0)
|
||||
{
|
||||
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)];
|
||||
}
|
||||
return ['not_found' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S', $tableName)];
|
||||
}
|
||||
catch(Exception $error)
|
||||
{
|
||||
return ['error' => $error->getMessage()];
|
||||
}
|
||||
}
|
||||
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
|
||||
}
|
||||
|
||||
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)];
|
||||
/**
|
||||
* Get a selected search value from a given table and row
|
||||
*
|
||||
* @param string $fieldName The field key
|
||||
* @param int $rowId The item ID
|
||||
* @param string $tableName The table
|
||||
* @param string $searchValue The value to search for
|
||||
* @param string|null $replaceValue The value to replace search value
|
||||
* @param int $matchCase The switch to control match case
|
||||
* @param int $wholeWord The switch to control whole word
|
||||
* @param int $regexSearch The switch to control regex search
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function getSearchValue(string $fieldName, int $rowId, string $tableName,
|
||||
string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch): array
|
||||
{
|
||||
// check if this is a valid table and field
|
||||
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName))
|
||||
{
|
||||
try
|
||||
{
|
||||
// load the configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->type_search = 1;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->replace_value = $replaceValue;
|
||||
SearchFactory::_('Config')->match_case = $matchCase;
|
||||
SearchFactory::_('Config')->whole_word = $wholeWord;
|
||||
SearchFactory::_('Config')->regex_search = $regexSearch;
|
||||
|
||||
if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, 0, $tableName)) !== null)
|
||||
{
|
||||
// load the value
|
||||
return ['value' => $value];
|
||||
}
|
||||
}
|
||||
catch(Exception $error)
|
||||
{
|
||||
return ['error' => $error->getMessage()];
|
||||
}
|
||||
}
|
||||
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a replaced search value from a given table and row
|
||||
*
|
||||
* @param string $fieldName The field key
|
||||
* @param int $rowId The item ID
|
||||
* @param mixed $line The line line
|
||||
* @param string $tableName The table
|
||||
* @param string $searchValue The value to search for
|
||||
* @param string|null $replaceValue The value to replace search value
|
||||
* @param int $matchCase The switch to control match case
|
||||
* @param int $wholeWord The switch to control whole word
|
||||
* @param int $regexSearch The switch to control regex search
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function getReplaceValue(string $fieldName, int $rowId, $line, string $tableName,
|
||||
string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch): array
|
||||
{
|
||||
// check if this is a valid table and field
|
||||
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName))
|
||||
{
|
||||
try
|
||||
{
|
||||
// load the configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->type_search = 2;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->replace_value = $replaceValue;
|
||||
SearchFactory::_('Config')->match_case = $matchCase;
|
||||
SearchFactory::_('Config')->whole_word = $wholeWord;
|
||||
SearchFactory::_('Config')->regex_search = $regexSearch;
|
||||
|
||||
// load the value
|
||||
if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, $line, $tableName, true)) !== null)
|
||||
{
|
||||
return ['value' => $value];
|
||||
}
|
||||
}
|
||||
catch(Exception $error)
|
||||
{
|
||||
return ['error' => $error->getMessage()];
|
||||
}
|
||||
}
|
||||
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set selected search value in a given table and row
|
||||
*
|
||||
* @param mixed $value The field value
|
||||
* @param int $rowId The item ID
|
||||
* @param string $fieldName The field key
|
||||
* @param string $tableName The table
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function setValue($value, int $rowId, string $fieldName, string $tableName): array
|
||||
{
|
||||
// check if this is a valid table and field
|
||||
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName) &&
|
||||
SearchFactory::_('Agent')->setValue($value, $rowId, $fieldName, $tableName))
|
||||
{
|
||||
return ['success' => JText::sprintf(
|
||||
'<b>%s</b> (%s:%s) was successfully updated!',
|
||||
$tableName, $rowId, $fieldName)];
|
||||
}
|
||||
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
|
||||
}
|
||||
|
@ -139,69 +139,6 @@ class ComponentbuilderModelCompiler extends ListModel
|
||||
|
||||
public $compiler;
|
||||
|
||||
public function getComponents()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
// Order it by the ordering field.
|
||||
$query->select($db->quoteName(array('id', 'system_name'),array('id', 'name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
$query->order('modified DESC');
|
||||
$query->order('created DESC');
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
// return the result
|
||||
return $db->loadObjectList();
|
||||
}
|
||||
|
||||
public function getCompilerAnimations(&$errorMessage)
|
||||
{
|
||||
// convert error message to array
|
||||
$errorMessage = array();
|
||||
$searchArray = array(
|
||||
// add banners (width - height)
|
||||
'banner' => array(
|
||||
'728-90',
|
||||
'160-600'
|
||||
),
|
||||
// The build-gif by size (width - height)
|
||||
'builder-gif' => array(
|
||||
'480-540'
|
||||
)
|
||||
);
|
||||
// start search, and get
|
||||
foreach ($searchArray as $type => $sizes)
|
||||
{
|
||||
// per size
|
||||
foreach ($sizes as $size)
|
||||
{
|
||||
// get size
|
||||
if (($set_size = ComponentbuilderHelper::getDynamicContentSize($type, $size)) !== 0)
|
||||
{
|
||||
// we loop over all type size artwork
|
||||
for ($target = 1; $target <= $set_size; $target++)
|
||||
{
|
||||
if (!ComponentbuilderHelper::getDynamicContent($type, $size, false, 0, $target))
|
||||
{
|
||||
$errorMessage[] = JText::sprintf('COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS_JOOMLA_INSTALL', $type, $size, $target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if we had any errors
|
||||
if (ComponentbuilderHelper::checkArray($errorMessage))
|
||||
{
|
||||
// flatten the error message array
|
||||
$errorMessage = implode('<br />', $errorMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function builder()
|
||||
{
|
||||
// run compiler
|
||||
@ -359,5 +296,91 @@ class ComponentbuilderModelCompiler extends ListModel
|
||||
$this->cleanCache('mod_menu', 1);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all components in the system
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function getComponents(): array
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = $this->getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select only id and system name
|
||||
$query->select($db->quoteName(array('id', 'system_name'),array('id', 'name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
|
||||
|
||||
// only the active components
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
|
||||
// Order it by the ordering field.
|
||||
$query->order('modified DESC');
|
||||
$query->order('created DESC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
// return the result
|
||||
return $db->loadObjectList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all dynamic content
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function getDynamicContent(&$errorMessage): bool
|
||||
{
|
||||
// convert error message to array
|
||||
$errorMessage = [];
|
||||
$searchArray = [
|
||||
// add banners (width - height)
|
||||
'banner' => [
|
||||
'728-90',
|
||||
'160-600'
|
||||
],
|
||||
// The build-gif by size (width - height)
|
||||
'builder-gif' => [
|
||||
'480-540'
|
||||
]
|
||||
];
|
||||
// start search, and get
|
||||
foreach ($searchArray as $type => $sizes)
|
||||
{
|
||||
// per size
|
||||
foreach ($sizes as $size)
|
||||
{
|
||||
// get size
|
||||
if (($set_size = ComponentbuilderHelper::getDynamicContentSize($type, $size)) !== 0)
|
||||
{
|
||||
// we loop over all type size artwork
|
||||
for ($target = 1; $target <= $set_size; $target++)
|
||||
{
|
||||
if (!ComponentbuilderHelper::getDynamicContent($type, $size, false, 0, $target))
|
||||
{
|
||||
$errorMessage[] = JText::sprintf('COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS_JOOMLA_INSTALL', $type, $size, $target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if we had any errors
|
||||
if (ComponentbuilderHelper::checkArray($errorMessage))
|
||||
{
|
||||
// flatten the error message array
|
||||
$errorMessage = implode('<br />', $errorMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -153,6 +153,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NAME_MESSAGE"
|
||||
|
@ -608,6 +608,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_MESSAGE"
|
||||
@ -1786,6 +1788,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_MESSAGE"
|
||||
|
@ -137,6 +137,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_MESSAGE"
|
||||
|
@ -138,6 +138,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_MESSAGE"
|
||||
|
@ -116,6 +116,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_MESSAGE"
|
||||
@ -1118,6 +1120,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_FIELD_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_FIELD_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE"
|
||||
@ -322,6 +324,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE"
|
||||
|
@ -1217,6 +1217,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_MESSAGE"
|
||||
|
@ -890,6 +890,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_MESSAGE"
|
||||
|
@ -857,6 +857,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_LANGUAGE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_LANGUAGE_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_LAYOUT_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_LAYOUT_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_LIBRARY_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_LIBRARY_NAME_MESSAGE"
|
||||
|
@ -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"
|
||||
@ -448,6 +506,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_POWER_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_POWER_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_SERVER_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_SERVER_NAME_MESSAGE"
|
||||
|
@ -116,6 +116,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_SITE_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_SITE_VIEW_NAME_MESSAGE"
|
||||
@ -1137,6 +1139,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_SITE_VIEW_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_SITE_VIEW_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_SNIPPET_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_SNIPPET_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_SNIPPET_TYPE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_SNIPPET_TYPE_NAME_MESSAGE"
|
||||
|
@ -102,6 +102,8 @@
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_TEMPLATE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_TEMPLATE_NAME_MESSAGE"
|
||||
|
@ -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
|
||||
@ -693,17 +694,26 @@ class ComponentbuilderModelJoomla_components extends ListModel
|
||||
{
|
||||
$values = json_decode($values, true);
|
||||
}
|
||||
// let's check for just a string or int
|
||||
elseif (is_string($values) || (is_numeric($values) && $values > 0))
|
||||
{
|
||||
$values = [$values];
|
||||
}
|
||||
|
||||
// make sure we have an array of values
|
||||
if (!ComponentbuilderHelper::checkArray($values, true) || !ComponentbuilderHelper::checkString($table) || !ComponentbuilderHelper::checkString($key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// start the query
|
||||
$query = $this->_db->getQuery(true);
|
||||
// Select some fields
|
||||
$query->select(array('a.*'));
|
||||
|
||||
// From the componentbuilder_ANY table
|
||||
$query->from($this->_db->quoteName('#__componentbuilder_'. $table, 'a'));
|
||||
|
||||
// check if this is an array of integers
|
||||
if ($this->is_numeric($values))
|
||||
{
|
||||
@ -722,12 +732,14 @@ class ComponentbuilderModelJoomla_components extends ListModel
|
||||
return $this->_db->quote($var);
|
||||
}, $values)) . ')');
|
||||
}
|
||||
|
||||
// Implement View Level Access
|
||||
if (!$this->user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$groups = implode(',', $this->user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
|
||||
// Order the results by ordering
|
||||
$query->order('a.ordering ASC');
|
||||
// Load the items
|
||||
|
@ -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']))
|
||||
|
@ -271,7 +271,7 @@ class ComponentbuilderModelPowers extends ListModel
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.name LIKE '.$search.')');
|
||||
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.name LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +114,8 @@ class ComponentbuilderModelSearch extends ItemModel
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Get data
|
||||
// load the tables and components (soon)
|
||||
$data = ['tables' => SearchFactory::_('Table')->tables(), 'components' => null];
|
||||
// load the tables and components
|
||||
$data = ['tables' => SearchFactory::_('Table')->tables(), 'components' => $this->getComponents()];
|
||||
|
||||
|
||||
if (empty($data))
|
||||
@ -148,6 +148,51 @@ class ComponentbuilderModelSearch extends ItemModel
|
||||
return $this->_item[$pk];
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Method
|
||||
*
|
||||
* @return mixed item data object on success, false on failure.
|
||||
*
|
||||
*/
|
||||
public function getUrlValues()
|
||||
{
|
||||
|
||||
if (!isset($this->initSet) || !$this->initSet)
|
||||
{
|
||||
$this->user = JFactory::getUser();
|
||||
$this->userId = $this->user->get('id');
|
||||
$this->guest = $this->user->get('guest');
|
||||
$this->groups = $this->user->get('groups');
|
||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||
$this->initSet = true;
|
||||
}
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Get data
|
||||
$data = [
|
||||
'type_search' => SearchFactory::_('Config')->get('type_search', 1),
|
||||
'search_value' => SearchFactory::_('Config')->get('search_value', ''),
|
||||
'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),
|
||||
'table_name' => SearchFactory::_('Config')->get('table_name', -1)
|
||||
];
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// return data object.
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the uikit needed components
|
||||
*
|
||||
@ -162,4 +207,38 @@ class ComponentbuilderModelSearch extends ItemModel
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all components in the system
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
public function getComponents(): array
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = $this->getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select only id and system name
|
||||
$query->select($db->quoteName(array('id', 'system_name'),array('id', 'name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
|
||||
|
||||
// only the active components
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
|
||||
// Order it by the ordering field.
|
||||
$query->order('modified DESC');
|
||||
$query->order('created DESC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
// return the result
|
||||
return $db->loadObjectList();
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
1
admin/sql/updates/mysql/3.1.12.sql
Normal file
1
admin/sql/updates/mysql/3.1.12.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `#__componentbuilder_power` ADD `composer` TEXT NOT NULL AFTER `add_licensing_template`;
|
@ -25,7 +25,6 @@ $selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONEN
|
||||
$noticeboardOptions = array('vdm', 'pro');
|
||||
?>
|
||||
<?php if ($this->canDo->get('compiler.access')): ?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=compiler'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(task, key)
|
||||
@ -35,7 +34,7 @@ Joomla.submitbutton = function(task, key)
|
||||
} else {
|
||||
var component = jQuery('#component_id').val();
|
||||
var isValid = true;
|
||||
|
||||
|
||||
if(component == '' && task == 'compiler.compiler'){
|
||||
isValid = false;
|
||||
}
|
||||
@ -127,73 +126,78 @@ jQuery('<div id="compiling"></div>')
|
||||
<div id="j-main-container">
|
||||
<?php endif; ?>
|
||||
<?php if (ComponentbuilderHelper::checkString($this->SuccessMessage)): ?>
|
||||
<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<?= $this->SuccessMessage; ?>
|
||||
</div>
|
||||
<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<?php echo $this->SuccessMessage; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="form">
|
||||
<div class="span4">
|
||||
<h3><?= JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT') ?></h3>
|
||||
<div id="compilerForm">
|
||||
<div>
|
||||
<span class="notice" style="display:none; color:red;"><?= 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"><?= $field->label ?></div>
|
||||
<div class="controls"><?= $field->input ?></div>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=compiler'); ?>"
|
||||
method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<div id="form" >
|
||||
<div class="span4">
|
||||
<h3><?php echo JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT'); ?></h3>
|
||||
<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 endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<br />
|
||||
<div class="clearfix"></div>
|
||||
<button class="btn btn-small btn-success" onclick="Joomla.submitbutton('compiler.compiler')"><span class="icon-cog icon-white"></span>
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT'); ?>
|
||||
</button>
|
||||
<input type="hidden" name="install_item_id" value="0">
|
||||
<input type="hidden" name="version" value="3" />
|
||||
</div>
|
||||
<br />
|
||||
<div class="clearfix"></div>
|
||||
<button class="btn btn-small btn-success" onclick="Joomla.submitbutton('compiler.compiler')"><span class="icon-cog icon-white"></span>
|
||||
<?= JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT') ?>
|
||||
</button>
|
||||
<input type="hidden" name="install_item_id" value="0">
|
||||
<input type="hidden" name="version" value="3" />
|
||||
</div>
|
||||
<div class="span7">
|
||||
<div id="component-details"><?php echo $selectNotice; ?></div>
|
||||
<?php echo JLayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span7">
|
||||
<div id="component-details"><?= $selectNotice ?></div>
|
||||
<?= JLayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="get-compiler-animations" style="display:none;">
|
||||
<h1><?= JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT') ?></h1>
|
||||
<h4><?= JText::_('COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION') ?> <span class="loading-dots">.</span></h4>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div id="clear" style="display:none;">
|
||||
<h1><?= JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT') ?></h1>
|
||||
<h4><?= JText::_('COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL') ?> <span class="loading-dots">.</span></h4>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div id="compiler" style="display:none;">
|
||||
<div id="compiler-spinner" class="span4" style="display:none;">
|
||||
<h3><?= JText::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name) ?></h3>
|
||||
<p style="font-size: smaller;"><?= JText::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT') ?></p>
|
||||
<p><b><span class="component-name"><?= JText::_('COM_COMPONENTBUILDER_THE_COMPONENT') ?></span></b> <?= JText::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED') ?> <span class="loading-dots">.</span></p>
|
||||
<div style="text-align: center;"><?= ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size) ?></div>
|
||||
<div id="get-compiler-animations" style="display:none;">
|
||||
<h1><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
|
||||
<h4><?php echo JText::_('COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION'); ?> <span class="loading-dots">.</span></h4>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div id="compiler-notice" class="span7" style="display:none;">
|
||||
<?= JLayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null) ?>
|
||||
<div><?= ComponentbuilderHelper::getDynamicContent('banner', '728-90') ?></div>
|
||||
<div id="clear" style="display:none;">
|
||||
<h1><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
|
||||
<h4><?php echo JText::_('COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL'); ?> <span class="loading-dots">.</span></h4>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="compiler" style="display:none;">
|
||||
<div id="compiler-spinner" class="span4" style="display:none;">
|
||||
<h3><?php echo JText::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name); ?></h3>
|
||||
<p style="font-size: smaller;"><?php echo JText::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT'); ?></p>
|
||||
<p><b><span class="component-name"><?php echo JText::_('COM_COMPONENTBUILDER_THE_COMPONENT'); ?></span></b> <?php echo JText::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED'); ?> <span class="loading-dots">.</span></p>
|
||||
<div style="text-align: center;"><?php echo ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size); ?></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div id="compiler-notice" class="span7" style="display:none;">
|
||||
<?php echo JLayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null); ?>
|
||||
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// token
|
||||
var token = '<?= JSession::getFormToken() ?>';
|
||||
var all_is_good = '<?= JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME') ?>';
|
||||
var token = '<?php echo JSession::getFormToken(); ?>';
|
||||
var all_is_good = '<?php echo JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME'); ?>';
|
||||
jQuery('#compilerForm').on('change', '#component_id',function (e)
|
||||
{
|
||||
var component = jQuery('#component_id').val();
|
||||
if(component == "") {
|
||||
jQuery('#component-details').html("<?= $selectNotice ?>");
|
||||
jQuery('#component-details').html("<?php echo $selectNotice; ?>");
|
||||
jQuery("#noticeboard").show();
|
||||
jQuery('.notice').show();
|
||||
} else {
|
||||
@ -233,9 +237,6 @@ function JRouter(link) {
|
||||
return url+link;
|
||||
}
|
||||
</script>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
|
||||
<?php endif; ?>
|
||||
|
@ -40,11 +40,18 @@ class ComponentbuilderViewCompiler extends HtmlView
|
||||
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=compiler');
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
// get the success message if set
|
||||
$this->SuccessMessage = $this->app->getUserState('com_componentbuilder.success_message', false);
|
||||
|
||||
// get active components
|
||||
$this->Components = $this->get('Components');
|
||||
$this->form = $this->setForm();
|
||||
|
||||
// get the needed form fields
|
||||
$this->Form = $this->getDynamicForm();
|
||||
|
||||
// set the compiler artwork from global settings
|
||||
$this->builder_gif_size = $this->params->get('builder_gif_size', '480-272');
|
||||
|
||||
// only run these checks if he has access
|
||||
if ($this->canDo->get('compiler.compiler_animations'))
|
||||
{
|
||||
@ -96,7 +103,14 @@ class ComponentbuilderViewCompiler extends HtmlView
|
||||
// JLayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded
|
||||
// JLayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded
|
||||
|
||||
public function setForm()
|
||||
/**
|
||||
* Get the dynamic build form fields needed on the page
|
||||
*
|
||||
* @return array|null The array of form fields
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getDynamicForm(): ?array
|
||||
{
|
||||
if(ComponentbuilderHelper::checkArray($this->Components))
|
||||
{
|
||||
@ -209,8 +223,10 @@ class ComponentbuilderViewCompiler extends HtmlView
|
||||
// return the form array
|
||||
return $form;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
@ -396,7 +412,7 @@ class ComponentbuilderViewCompiler extends HtmlView
|
||||
if ($this->canDo->get('compiler.compiler_animations'))
|
||||
{
|
||||
// add Compiler Animations button.
|
||||
JToolBarHelper::custom('compiler.getCompilerAnimations', 'download custom-button-getcompileranimations', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false);
|
||||
JToolBarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false);
|
||||
}
|
||||
if ($this->canDo->get('compiler.clear_tmp'))
|
||||
{
|
||||
|
@ -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';
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -16,7 +16,16 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||
JHtml::_('behavior.formvalidator');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
JHtml::_('behavior.keepalive');
|
||||
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
|
||||
|
||||
// allow main menu selection
|
||||
$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';
|
||||
|
||||
// get main search input field
|
||||
$search_value = $this->form->getField('search_value');
|
||||
?>
|
||||
<?php if ($this->canDo->get('search.access')): ?>
|
||||
<script type="text/javascript">
|
||||
@ -32,7 +41,6 @@ use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
|
||||
}
|
||||
</script>
|
||||
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=search' . $urlId); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<?php if(!empty( $this->sidebar)): ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
@ -42,33 +50,291 @@ use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
|
||||
<?php else : ?>
|
||||
<div id="j-main-container">
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// let's do some tests with the API
|
||||
$tableName = 'admin_view';
|
||||
$searchValue = '\b\w+Helper';
|
||||
// set the search configurations
|
||||
SearchFactory::_('Config')->table_name = $tableName;
|
||||
SearchFactory::_('Config')->search_value = $searchValue;
|
||||
SearchFactory::_('Config')->match_case = 1;
|
||||
SearchFactory::_('Config')->whole_word = 0;
|
||||
SearchFactory::_('Config')->regex_search = 1;
|
||||
SearchFactory::_('Config')->component_id = 0;
|
||||
<?php if ($this->form): ?>
|
||||
<form action="<?php echo JRoute::_($url_search); ?>" method="post"
|
||||
name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<div class="form-horizontal">
|
||||
<div class="row-fluid" id="search_progress_block" style="display: none">
|
||||
<div class="uk-progress uk-progress-striped uk-active">
|
||||
<div id="search_progress_bar" class="uk-progress-bar" style="width: 0%;">0%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid" id="replace_progress_block" style="display: none">
|
||||
<div class="uk-progress uk-progress-small uk-progress-danger uk-progress-striped uk-active">
|
||||
<div id="replace_progress_bar" class="uk-progress-bar" style="width: 0%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid" id="search_details_block" style="display: none">
|
||||
<span id="search_details">
|
||||
<span class="search_details_title"><?php echo JText::_('COM_COMPONENTBUILDER_SEARCHED_FOR'); ?></span>:
|
||||
[<span id="searched" class="found_code">....</span>]
|
||||
</span>
|
||||
<span id="replace_details" style="display: none">
|
||||
<span class="search_details_title"><?php echo JText::_('COM_COMPONENTBUILDER_REPLACED_WITH'); ?></span>:
|
||||
[<span id="replaced" class="found_code">....</span>]
|
||||
</span>
|
||||
<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'); ?>
|
||||
<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'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid" id="search_results_block">
|
||||
<hr>
|
||||
<div id="search_results_table_block">
|
||||
<?php echo JLayoutHelper::render('table', ['id' => 'search_results_table', 'headers' => $this->table_headers, 'items' => 7, 'init' => false]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid" id="item_view_block">
|
||||
<div id="item_notice_block" style="display: none">
|
||||
<hr>
|
||||
<span id="item_edit_button"></span>
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_TABLE'); ?>: <b><span id="item_table_name">
|
||||
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_ID'); ?>:<b><span id="item_row_id">
|
||||
</span></b>) |
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD'); ?>: <b><span id="item_field_name">
|
||||
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_LINE'); ?>:<b><span id="item_line_number">
|
||||
</span></b>)
|
||||
<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>
|
||||
<?php if (isset($this->item['tables']) && ComponentbuilderHelper::checkArray($this->item['tables'])) : ?>
|
||||
<script>
|
||||
// To class="uk-autoload uk-progress" UIkit.notify
|
||||
|
||||
if (($items = SearchFactory::_('Agent')->find()) !== null)
|
||||
{
|
||||
echo JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName) . '<br /><pre>';
|
||||
var_dump($items);
|
||||
echo '</pre>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S', $tableName);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
// get search table values
|
||||
const searchTables = <?php echo json_encode($this->item['tables']); ?>;
|
||||
|
||||
// the search Ajax URLs
|
||||
const UrlAjax = '<?php echo $url_base; ?>&format=json&raw=true&<?php echo JSession::getFormToken(); ?>=1&task=ajax.';
|
||||
|
||||
// the search URL
|
||||
const UrlSearch = '<?php echo $url_search; ?>';
|
||||
|
||||
// make sure our controller is set
|
||||
let controller = null;
|
||||
let controller_replace = null;
|
||||
|
||||
// some counters
|
||||
var fieldCount = 0;
|
||||
var lineCount = 0;
|
||||
|
||||
// start search time keepers
|
||||
var startSearchTime, endSearchTime;
|
||||
|
||||
// active edit button of row selected
|
||||
var editButtonSelected;
|
||||
|
||||
// get search progress area
|
||||
const searchProgressObject = document.getElementById("search_progress_block");
|
||||
const searchProgressBarObject = document.getElementById("search_progress_bar");
|
||||
const replaceProgressObject = document.getElementById("replace_progress_block");
|
||||
const replaceProgressBarObject = document.getElementById("replace_progress_bar");
|
||||
|
||||
// get search settings area
|
||||
const searchSettingsObject = document.getElementById("search_settings_block");
|
||||
const searchDetailsObject = document.getElementById("search_details_block");
|
||||
const searchedObject = document.getElementById("searched");
|
||||
|
||||
// get replace settings area
|
||||
const replaceDetailsObject = document.getElementById("replace_details");
|
||||
const replacedObject = document.getElementById("replaced");
|
||||
|
||||
// set the search mode objects
|
||||
const modeObject = document.getElementById("type_search");
|
||||
const typeSearchObject = document.getElementById("type_search0");
|
||||
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");
|
||||
const matchObject = document.getElementById("search_behaviour0");
|
||||
const wholeObject = document.getElementById("search_behaviour1");
|
||||
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 = startSearch;
|
||||
|
||||
// when the made changes and there is replace value do search
|
||||
modeObject.onchange = startSearch;
|
||||
replaceObject.onkeyup = startSearch;
|
||||
|
||||
// Do the search on key up of search input elements
|
||||
matchObject.onchange = startSearch;
|
||||
wholeObject.onchange = startSearch;
|
||||
regexObject.onchange = startSearch;
|
||||
tableObject.onchange = startSearch;
|
||||
|
||||
// set the item notice area
|
||||
const itemNoticeObject = document.getElementById("item_notice_block");
|
||||
const itemEditButtonObject = document.getElementById("item_edit_button");
|
||||
const itemTableNameObject = document.getElementById("item_table_name");
|
||||
const itemRowIdObject = document.getElementById("item_row_id");
|
||||
const itemFieldNameObject = document.getElementById("item_field_name");
|
||||
const itemLineNumberObject = document.getElementById("item_line_number");
|
||||
|
||||
// set the update buttons
|
||||
const buttonUpdateItemObject = document.getElementById("item_button_update");
|
||||
const buttonUpdateAllObject = document.querySelectorAll(".update_all_block");
|
||||
|
||||
// get the editor
|
||||
var editorObject;
|
||||
|
||||
// set some global objects
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// get the editor
|
||||
editorObject = Joomla.editors.instances['item_code'];
|
||||
});
|
||||
|
||||
// configurations of the table
|
||||
const tableConfigObject = {
|
||||
responsive: true,
|
||||
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 },
|
||||
{ 'targets': [ 0, 1 ], type: 'html' },
|
||||
{ responsivePriority: 1, targets: 1 },
|
||||
{ responsivePriority: 2, targets: 2 },
|
||||
{ responsivePriority: 3, targets: 3 }
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
data: 'edit'
|
||||
},
|
||||
{
|
||||
data: 'code'
|
||||
},
|
||||
{
|
||||
data: 'table'
|
||||
},
|
||||
{
|
||||
data: 'field'
|
||||
},
|
||||
{
|
||||
data: 'id',
|
||||
width: "15px",
|
||||
className: "small_column"
|
||||
},
|
||||
{
|
||||
data: 'line',
|
||||
width: "15px",
|
||||
className: "small_column"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// set some table object
|
||||
var tableSearchObject;
|
||||
var tableLengthObject;
|
||||
var tableActiveObject;
|
||||
|
||||
// The Result Table Code
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
// init the table
|
||||
let searchResultsTable = new DataTable('#search_results_table', tableConfigObject);
|
||||
|
||||
searchResultsTable.on( 'select', function ( e, dt, type, indexes ) {
|
||||
if ( type === 'row' ) {
|
||||
// get the data from the row
|
||||
let data = searchResultsTable.rows( indexes ).data();
|
||||
|
||||
// get the item data
|
||||
let item_id = data[0].id;
|
||||
let item_table = data[0].table;
|
||||
let item_field = data[0].field;
|
||||
let item_line = data[0].line;
|
||||
|
||||
// set the active edit button
|
||||
editButtonSelected = data[0].edit;
|
||||
// set active row
|
||||
tableActiveObject = searchResultsTable.row( indexes );
|
||||
|
||||
// get selected item
|
||||
getSelectedItem(item_table, item_id, item_field, item_line);
|
||||
|
||||
// hide the search settings
|
||||
hideSearch();
|
||||
}
|
||||
});
|
||||
|
||||
searchResultsTable.on( 'deselect', function ( e, dt, type, indexes ) {
|
||||
if ( type === 'row' ) {
|
||||
clearSelectedItem(false);
|
||||
}
|
||||
});
|
||||
|
||||
// set the table search object
|
||||
tableSearchObject = document.getElementById("search_results_table_filter");
|
||||
tableLengthObject = document.getElementById("search_results_table_length");
|
||||
|
||||
showSearch();
|
||||
<?php if (strlen($this->urlvalues['search_value']) > 0): ?>
|
||||
startSearch(null, true);
|
||||
<?php endif; ?>
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
|
||||
<?php endif; ?>
|
||||
|
@ -13,6 +13,9 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* Componentbuilder Html View class for the Search
|
||||
@ -32,13 +35,52 @@ class ComponentbuilderViewSearch extends HtmlView
|
||||
$this->canDo = ComponentbuilderHelper::getActions('search');
|
||||
// Initialise variables.
|
||||
$this->item = $this->get('Item');
|
||||
$this->urlvalues = $this->get('UrlValues');
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
ComponentbuilderHelper::addSubmenu('search');
|
||||
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=search');
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
}
|
||||
|
||||
// get the needed form fields
|
||||
$this->form = $this->getDynamicForm();
|
||||
|
||||
// build our table headers
|
||||
$this->table_headers = array(
|
||||
'edit' => 'E',
|
||||
'code' => JText::_('COM_COMPONENTBUILDER_FOUND_TEXT'),
|
||||
'table' => JText::_('COM_COMPONENTBUILDER_TABLE'),
|
||||
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
|
||||
'id' => JText::_('ID'),
|
||||
'line' => JText::_('COM_COMPONENTBUILDER_LINE')
|
||||
);
|
||||
|
||||
// set some JavaScript Language
|
||||
JText::script('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW');
|
||||
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_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');
|
||||
JText::script('COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE');
|
||||
JText::script('COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE');
|
||||
JText::script('COM_COMPONENTBUILDER_SEARCHING');
|
||||
JText::script('COM_COMPONENTBUILDER_TABLES_WITH');
|
||||
JText::script('COM_COMPONENTBUILDER_FIELDS_THAT_HAD');
|
||||
JText::script('COM_COMPONENTBUILDER_LINES');
|
||||
JText::script('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN');
|
||||
JText::script('COM_COMPONENTBUILDER_SECONDS');
|
||||
JText::script('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH');
|
||||
JText::script('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH');
|
||||
JText::script('COM_COMPONENTBUILDER_YES_UPDATE_ALL');
|
||||
JText::script('COM_COMPONENTBUILDER_NO');
|
||||
JText::script('COM_COMPONENTBUILDER_YES');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
@ -59,6 +101,206 @@ class ComponentbuilderViewSearch extends HtmlView
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dynamic build form fields needed on the page
|
||||
*
|
||||
* @return Form|null The array of form fields
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getDynamicForm(): ?Form
|
||||
{
|
||||
if(ComponentbuilderHelper::checkArray($this->item) &&
|
||||
ComponentbuilderHelper::checkArray($this->item['tables']) &&
|
||||
ComponentbuilderHelper::checkArray($this->item['components']))
|
||||
{
|
||||
// start the form
|
||||
$form = new Form('Search');
|
||||
|
||||
$form->load('<form
|
||||
addrulepath="/administrator/components/com_componentbuilder/models/rules"
|
||||
addfieldpath="/administrator/components/com_componentbuilder/models/fields">
|
||||
<fieldset name="search"></fieldset>
|
||||
<fieldset name="settings"></fieldset>
|
||||
<fieldset name="view"></fieldset>
|
||||
</form>');
|
||||
|
||||
// Search Mode
|
||||
$attributes = [
|
||||
'type' => 'radio',
|
||||
'name' => 'type_search',
|
||||
'hiddenLabel' => true,
|
||||
'label' => 'COM_COMPONENTBUILDER_MODE',
|
||||
'class' => 'btn-group',
|
||||
'description' => 'COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE',
|
||||
'default' => $this->urlvalues['type_search']];
|
||||
// set the mode options
|
||||
$options = [
|
||||
1 => 'COM_COMPONENTBUILDER_SEARCH',
|
||||
2 => 'COM_COMPONENTBUILDER_REPLACE',
|
||||
0 => 'COM_COMPONENTBUILDER_CLEAR'];
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'search');
|
||||
}
|
||||
|
||||
// search text attributes
|
||||
$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 span11',
|
||||
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT',
|
||||
'autocomplete' => true,
|
||||
'default' => $this->urlvalues['search_value']];
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'search');
|
||||
}
|
||||
|
||||
// replace text attributes
|
||||
$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 span11',
|
||||
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT',
|
||||
'autocomplete' => true,
|
||||
'showon' => 'type_search:2',
|
||||
'default' => $this->urlvalues['replace_value']];
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'search');
|
||||
}
|
||||
|
||||
// Search Behaviour
|
||||
$default = [];
|
||||
if ($this->urlvalues['match_case'] == 1)
|
||||
{
|
||||
$default[] = 'match_case';
|
||||
}
|
||||
if ($this->urlvalues['whole_word'] == 1)
|
||||
{
|
||||
$default[] = 'whole_word';
|
||||
}
|
||||
if ($this->urlvalues['regex_search'] == 1)
|
||||
{
|
||||
$default[] = 'regex_search';
|
||||
}
|
||||
$attributes = [
|
||||
'type' => 'checkboxes',
|
||||
'name' => 'search_behaviour',
|
||||
'label' => 'COM_COMPONENTBUILDER_BEHAVIOUR',
|
||||
'description' => 'COM_COMPONENTBUILDER_SET_THE_SEARCH_BEHAVIOUR_HERE'];
|
||||
if (ComponentbuilderHelper::checkArray($default))
|
||||
{
|
||||
$attributes['default'] = implode(',', $default);
|
||||
}
|
||||
// set the mode options
|
||||
$options = [
|
||||
'match_case' => 'COM_COMPONENTBUILDER_MATCH_CASE',
|
||||
'whole_word' => 'COM_COMPONENTBUILDER_WHOLE_WORD',
|
||||
'regex_search' => 'COM_COMPONENTBUILDER_REGEX_SEARCH'];
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'settings');
|
||||
}
|
||||
|
||||
// component attributes
|
||||
$attributes = [
|
||||
'type' => 'list',
|
||||
'name' => 'component_id',
|
||||
'label' => 'COM_COMPONENTBUILDER_COMPONENTS_BR_SMALLDISABLED_SOONSMALL',
|
||||
'class' => 'list_class',
|
||||
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_SEARCH',
|
||||
'required' => 'true',
|
||||
'disable' => 'true',
|
||||
'readonly' => 'true',
|
||||
'default' => -1];
|
||||
// start the component options
|
||||
$options = [];
|
||||
$options['-1'] = 'COM_COMPONENTBUILDER__SEARCH_ALL_';
|
||||
// load component options from array
|
||||
foreach($this->item['components'] as $component)
|
||||
{
|
||||
$options[(int) $component->id] = $this->escape($component->name);
|
||||
}
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'settings');
|
||||
}
|
||||
|
||||
// table attributes
|
||||
$attributes = [
|
||||
'type' => 'list',
|
||||
'name' => 'table_name',
|
||||
'label' => 'COM_COMPONENTBUILDER_TABLES',
|
||||
'class' => 'list_class',
|
||||
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_TABLE_TO_SEARCH',
|
||||
'required' => 'true',
|
||||
'default' => $this->urlvalues['table_name']];
|
||||
// start the component options
|
||||
$options = [];
|
||||
$options['-1'] = 'COM_COMPONENTBUILDER__SEARCH_ALL_';
|
||||
// load table options from array
|
||||
foreach($this->item['tables'] as $table)
|
||||
{
|
||||
$options[$table] = $this->escape($table);
|
||||
}
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'settings');
|
||||
}
|
||||
|
||||
// editor attributes
|
||||
$attributes = [
|
||||
'type' => 'editor',
|
||||
'name' => 'item_code',
|
||||
'label' => 'COM_COMPONENTBUILDER_ITEM_CODE',
|
||||
'width' => '100%',
|
||||
'height' => '150px',
|
||||
'class' => 'item_code_editor',
|
||||
'syntax' => 'php',
|
||||
'buttons' => 'false',
|
||||
'filter' => 'raw',
|
||||
'editor' => 'codemirror|none'];
|
||||
// add to form
|
||||
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
|
||||
if ($xml instanceof SimpleXMLElement)
|
||||
{
|
||||
$form->setField($xml, null, true, 'view');
|
||||
}
|
||||
|
||||
// return the form array
|
||||
return $form;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*/
|
||||
@ -72,6 +314,15 @@ class ComponentbuilderViewSearch extends HtmlView
|
||||
// Initialize the header checker.
|
||||
$HeaderCheck = new componentbuilderHeaderCheck;
|
||||
|
||||
// always load these files.
|
||||
$this->document->addStyleSheet(JURI::root(true) . "/media/com_componentbuilder/datatable/css/datatables.min.css", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");
|
||||
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/pdfmake.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
|
||||
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/vfs_fonts.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
|
||||
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/datatables.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
|
||||
|
||||
// Add View JavaScript File
|
||||
$this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/search.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
|
||||
|
||||
// Load uikit options.
|
||||
$uikit = $this->params->get('uikit_load');
|
||||
// Set script size.
|
||||
@ -89,6 +340,41 @@ class ComponentbuilderViewSearch extends HtmlView
|
||||
{
|
||||
JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
|
||||
}
|
||||
|
||||
// Load the script to find all uikit components needed.
|
||||
if ($uikit != 2)
|
||||
{
|
||||
// Set the default uikit components in this view.
|
||||
$uikitComp = array();
|
||||
$uikitComp[] = 'UIkit.notify';
|
||||
$uikitComp[] = 'uk-progress';
|
||||
}
|
||||
|
||||
// Load the needed uikit components in this view.
|
||||
if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp))
|
||||
{
|
||||
// load just in case.
|
||||
jimport('joomla.filesystem.file');
|
||||
// loading...
|
||||
foreach ($uikitComp as $class)
|
||||
{
|
||||
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
||||
{
|
||||
// check if the CSS file exists.
|
||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
||||
{
|
||||
// load the css.
|
||||
JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||
}
|
||||
// check if the JavaScript file exists.
|
||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
||||
{
|
||||
// load the js.
|
||||
JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// add the document default css file
|
||||
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="4" method="upgrade">
|
||||
<name>COM_COMPONENTBUILDER</name>
|
||||
<creationDate>20th September, 2022</creationDate>
|
||||
<creationDate>29th January, 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.6</version>
|
||||
<version>3.1.13</version>
|
||||
<description>< is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
|
||||
|
||||
<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.
|
||||
|
||||
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!</p>
|
||||
<p>Created by <a href="https://dev.vdm.io" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 30th April, 2015</small></p>
|
||||
]]></description>
|
||||
@ -39,6 +39,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
|
||||
<folder>js</folder>
|
||||
<folder>css</folder>
|
||||
<folder>images</folder>
|
||||
<folder>datatable</folder>
|
||||
<folder>uikit-v2</folder>
|
||||
<folder>footable-v3</folder>
|
||||
</media>
|
||||
@ -74,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>
|
||||
@ -123,4 +124,4 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
|
||||
<updateservers>
|
||||
<server type="extension" enabled="1" element="com_componentbuilder" name="Component Builder">https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/componentbuilder_update_server.xml</server>
|
||||
</updateservers>
|
||||
</extension>
|
||||
</extension>
|
||||
|
@ -1097,10 +1097,27 @@
|
||||
<element>pkg_component_builder</element>
|
||||
<type>package</type>
|
||||
<client>site</client>
|
||||
<version>3.1.6</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.6.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>com_componentbuilder</element>
|
||||
<type>component</type>
|
||||
<version>3.1.13</version>
|
||||
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
|
||||
</downloads>
|
||||
<tags>
|
||||
<tag>stable</tag>
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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';
|
||||
|
@ -2,17 +2,17 @@
|
||||
/**
|
||||
* @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;
|
||||
namespace VDM\Joomla\Componentbuilder\Abstraction;
|
||||
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\Input\Input;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
@ -20,11 +20,11 @@ use VDM\Joomla\Utilities\String\ClassfunctionHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Configurations
|
||||
* Config
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseConfig extends Registry
|
||||
abstract class BaseConfig extends JoomlaRegistry
|
||||
{
|
||||
/**
|
||||
* Hold a JInput object for easier access to the input variables.
|
||||
@ -32,15 +32,15 @@ abstract class BaseConfig extends Registry
|
||||
* @var Input
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected $input;
|
||||
protected Input $input;
|
||||
|
||||
/**
|
||||
* The Params
|
||||
*
|
||||
* @var Registry
|
||||
* @var JoomlaRegistry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Registry $params;
|
||||
protected JoomlaRegistry $params;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -51,7 +51,7 @@ abstract class BaseConfig extends Registry
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Input $input = null, ?Registry $params = null)
|
||||
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null)
|
||||
{
|
||||
$this->input = $input ?: Factory::getApplication()->input;
|
||||
$this->params = $params ?: Helper::getParams('com_componentbuilder');
|
||||
@ -66,12 +66,12 @@ abstract class BaseConfig extends Registry
|
||||
/**
|
||||
* 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 Registry
|
||||
/**
|
||||
* 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_')
|
||||
@ -92,13 +92,13 @@ abstract class BaseConfig extends Registry
|
||||
return $value;
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method));
|
||||
throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function or path.', $key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 Registry
|
||||
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 Registry
|
||||
}
|
||||
elseif (method_exists($this, $method))
|
||||
{
|
||||
$value = $this->{$method}();
|
||||
$value = $this->{$method}($default);
|
||||
|
||||
$this->set($path, $value);
|
||||
|
||||
@ -126,6 +126,27 @@ abstract class BaseConfig extends Registry
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,150 @@
|
||||
<?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\Registry\Registry as JoomlaRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* Registry
|
||||
*
|
||||
* So we have full control over this class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseRegistry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable
|
||||
{
|
||||
/**
|
||||
* Method to iterate over any part of the registry
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return \ArrayIterator|null This object represented as an ArrayIterator.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function _(string $path): ?\ArrayIterator
|
||||
{
|
||||
$data = $this->extract($path);
|
||||
|
||||
if ($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
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;
|
||||
|
||||
}
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,851 @@
|
||||
<?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 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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,18 +12,95 @@
|
||||
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\BaseConfig;
|
||||
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 posted component id
|
||||
*
|
||||
@ -35,6 +112,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 +158,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,6 +172,20 @@ class Config extends BaseConfig
|
||||
return $this->input->post->get('joomla_version', 3, 'INT');
|
||||
}
|
||||
|
||||
/**
|
||||
* get Joomla versions
|
||||
*
|
||||
* @return array Joomla versions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getJoomlaversions(): array
|
||||
{
|
||||
return [
|
||||
3 => ['folder_key' => 3, 'xml_version' => 3.9], // only joomla 3
|
||||
3.10 => ['folder_key' => 3, 'xml_version' => 4.0] // legacy joomla 4
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* get posted Joomla version name
|
||||
*
|
||||
@ -95,6 +197,17 @@ 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 indentation value
|
||||
*
|
||||
@ -138,15 +251,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 +267,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 +282,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 +304,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 +337,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 +406,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 +445,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 +460,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 +504,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 +560,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 +578,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 +599,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 +642,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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
@ -255,7 +255,7 @@ class External implements ExternalInterface
|
||||
))
|
||||
{
|
||||
// update the hash since it changed
|
||||
$object = new stdClass();
|
||||
$object = new \stdClass();
|
||||
$object->target = $target_key;
|
||||
$object->hash = $live_hash;
|
||||
// update local hash
|
||||
@ -296,7 +296,7 @@ class External implements ExternalInterface
|
||||
))
|
||||
{
|
||||
// add the hash to track changes
|
||||
$object = new stdClass();
|
||||
$object = new \stdClass();
|
||||
$object->target = $target_key;
|
||||
$object->hash = $live_hash;
|
||||
// insert local hash
|
||||
@ -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] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
@ -327,16 +327,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 +358,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 +403,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 +430,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 +482,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 +492,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 +504,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;
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user