Added open Collective to the readme, thanks @monkeywithacupcake. Added default selection to adding admin views to component. Update some helper methods, and comments.

This commit is contained in:
Llewellyn van der Merwe 2018-12-19 06:06:36 +02:00
parent a52d230aeb
commit 279831da30
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
21 changed files with 581 additions and 533 deletions

View File

@ -1,5 +1,7 @@
# Joomla Component Builder (JCB)
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases)
[![Backers on Open Collective](https://opencollective.com/Joomla-Component-Builder/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/Joomla-Component-Builder/sponsors/badge.svg)](#sponsors)
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,29 +11,36 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.9.7) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.9.8) 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 upgrade area.
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 Components.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
+ Unlimited Tables/Views.
+ Reusing Views and Fields.
+ Runs on Your Own Joomla Install.
+ 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 Standard Field Types (including repeatable fields).
+ Strong Implementation of all Joomla Form Security.
+ 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.
@ -40,13 +49,13 @@ Some of the Features
+ 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 complier view.
+ Integrative with native Joomla Categories and Tags.
+ 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 default upgrade of components.
+ 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.
@ -55,8 +64,8 @@ Some of the Features
Just Imagine
====================
+ Your Component Back-end can be more advanced then the Joomla Article Manager.
+ Your Code as Perfectly Unified to the strict Joomla Standards.
+ 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.
@ -76,13 +85,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in JCB and import into another JCB.
+ 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
====================
> The cat is out of the bag, JCB fully mapped can now be yours! Including many other JCB mapped components.
> The cat is out of the bag, [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)!
@ -95,37 +104,38 @@ Where can you get support and help?
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://github.com/vdm-io/Joomla-Component-Builder/wiki)
+ [JCB Google Group/forum](https://groups.google.com/a/vdm.io/d/forum/jcb)
+ [JCB Google Group/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 Github](https://github.com/vdm-io/Joomla-Component-Builder/issues) ^^
+ [JCB IRC Channel](https://vdm.bz/jcb-irc)
Since JCB has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://groups.google.com/a/vdm.io/d/forum/jcb) 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.
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 code, like bugs, **start by searching** the (*open & closed*) issues over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/.github/CONTRIBUTING.md).
^^ Then if you run into any issues, related to the [JCB](http://joomlacomponentbuilder.com) code, like bugs, **start by searching** the (*open & closed*) issues over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/.github/CONTRIBUTING.md).
WHY GIVE IT AWAY LIKE THIS?
====================
> We are Open Source Enthusiast
> Who Support the Joomla Community
> 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 GitHub issues, and you can even help us develop/improve the pipeline of JCB for continues delivery. We really want to see JCB remain the tool of choice for all Joomla Component Development needs and ideas.
Get involved on the forums, and the GitHub 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 (REST) API ability for all components build with JCB. So we can link any component build with JCB to an Android/Apple APP.
- Add automatic unit testing. To nurture pipeline integration for all components build with JCB.
- Team collaborative development across JCB installations offline and online.
- Documentation (maintained by the community) for JCB. (help us select the best system for this)
- Add automatic (REST) API ability for all components build with [JCB](http://joomlacomponentbuilder.com). So we can link any component build with JCB to an Android/Apple APP.
- 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
@ -133,21 +143,35 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th November, 2018
+ *Version*: 2.9.7
+ *Last Build*: 19th December, 2018
+ *Version*: 2.9.8
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **195519**
+ *Line count*: **195554**
+ *Field count*: **1087**
+ *File count*: **1275**
+ *Folder count*: **201**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> 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)
## Donations
## Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors"><img src="https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false" /></a>
Come on buy VDM a coffee :)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) (Asseblief = Please) in Afrikaans
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
<a href="https://opencollective.com/Joomla-Component-Builder#backers" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890"></a>
### 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)]
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/0/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/1/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/2/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/3/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/4/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/5/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/6/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/7/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/8/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/9/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg"></a>

View File

@ -1,5 +1,7 @@
# Joomla Component Builder (JCB)
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases)
[![Backers on Open Collective](https://opencollective.com/Joomla-Component-Builder/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/Joomla-Component-Builder/sponsors/badge.svg)](#sponsors)
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,29 +11,36 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.9.7) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.9.8) 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 upgrade area.
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 Components.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
+ Unlimited Tables/Views.
+ Reusing Views and Fields.
+ Runs on Your Own Joomla Install.
+ 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 Standard Field Types (including repeatable fields).
+ Strong Implementation of all Joomla Form Security.
+ 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.
@ -40,13 +49,13 @@ Some of the Features
+ 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 complier view.
+ Integrative with native Joomla Categories and Tags.
+ 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 default upgrade of components.
+ 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.
@ -55,8 +64,8 @@ Some of the Features
Just Imagine
====================
+ Your Component Back-end can be more advanced then the Joomla Article Manager.
+ Your Code as Perfectly Unified to the strict Joomla Standards.
+ 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.
@ -76,13 +85,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in JCB and import into another JCB.
+ 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
====================
> The cat is out of the bag, JCB fully mapped can now be yours! Including many other JCB mapped components.
> The cat is out of the bag, [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)!
@ -95,37 +104,38 @@ Where can you get support and help?
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://github.com/vdm-io/Joomla-Component-Builder/wiki)
+ [JCB Google Group/forum](https://groups.google.com/a/vdm.io/d/forum/jcb)
+ [JCB Google Group/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 Github](https://github.com/vdm-io/Joomla-Component-Builder/issues) ^^
+ [JCB IRC Channel](https://vdm.bz/jcb-irc)
Since JCB has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://groups.google.com/a/vdm.io/d/forum/jcb) 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.
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 code, like bugs, **start by searching** the (*open & closed*) issues over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/.github/CONTRIBUTING.md).
^^ Then if you run into any issues, related to the [JCB](http://joomlacomponentbuilder.com) code, like bugs, **start by searching** the (*open & closed*) issues over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/.github/CONTRIBUTING.md).
WHY GIVE IT AWAY LIKE THIS?
====================
> We are Open Source Enthusiast
> Who Support the Joomla Community
> 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 GitHub issues, and you can even help us develop/improve the pipeline of JCB for continues delivery. We really want to see JCB remain the tool of choice for all Joomla Component Development needs and ideas.
Get involved on the forums, and the GitHub 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 (REST) API ability for all components build with JCB. So we can link any component build with JCB to an Android/Apple APP.
- Add automatic unit testing. To nurture pipeline integration for all components build with JCB.
- Team collaborative development across JCB installations offline and online.
- Documentation (maintained by the community) for JCB. (help us select the best system for this)
- Add automatic (REST) API ability for all components build with [JCB](http://joomlacomponentbuilder.com). So we can link any component build with JCB to an Android/Apple APP.
- 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
@ -133,21 +143,35 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th November, 2018
+ *Version*: 2.9.7
+ *Last Build*: 19th December, 2018
+ *Version*: 2.9.8
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **195519**
+ *Line count*: **195554**
+ *Field count*: **1087**
+ *File count*: **1275**
+ *Folder count*: **201**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> 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)
## Donations
## Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors"><img src="https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false" /></a>
Come on buy VDM a coffee :)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) (Asseblief = Please) in Afrikaans
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
<a href="https://opencollective.com/Joomla-Component-Builder#backers" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890"></a>
### 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)]
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/0/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/1/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/2/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/3/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/4/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/5/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/6/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/7/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/8/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/Joomla-Component-Builder/sponsor/9/website" target="_blank"><img src="https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg"></a>

View File

@ -23,7 +23,7 @@ defined('_JEXEC') or die('Restricted access');
abstract class ###Component###Helper
{###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
/**
* Load the Component xml manifest.
* Load the Component xml manifest.
**/
public static function manifest()
{
@ -32,12 +32,12 @@ abstract class ###Component###Helper
}
/**
* Joomla version object
* Joomla version object
**/
protected static $JVersion;
/**
* set/get Joomla version
* set/get Joomla version
**/
public static function jVersion()
{
@ -50,7 +50,7 @@ abstract class ###Component###Helper
}
/**
* Load the Contributors details.
* Load the Contributors details.
**/
public static function getContributors()
{
@ -88,7 +88,7 @@ abstract class ###Component###Helper
}###HELP###
/**
* Configure the Linkbar.
* Configure the Linkbar.
**/
public static function addSubmenu($submenu)
{
@ -494,7 +494,7 @@ abstract class ###Component###Helper
}
/**
* Get any component's model
* Get any component's model
**/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = '###Component###', $config = array())
{
@ -538,9 +538,9 @@ abstract class ###Component###Helper
}
/**
* Add to asset Table
* Add to asset Table
*/
public static function setAsset($id,$table)
public static function setAsset($id, $table, $inherit = true)
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_###component###');
@ -572,7 +572,7 @@ abstract class ###Component###Helper
$asset->name = $name;
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_###component###',$table);
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
if ($rules instanceof JAccessRules)
{
$asset->rules = (string) $rules;
@ -600,55 +600,62 @@ abstract class ###Component###Helper
}
/**
* Gets the default asset Rules for a component/view.
* Gets the default asset Rules for a component/view.
*/
protected static function getDefaultAssetRules($component,$view)
protected static function getDefaultAssetRules($component, $view, $inherit = true)
{
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
if ($db->loadRowList())
// if new or inherited
$assetId = 0;
// Only get the actual item rules if not inheriting
if (!$inherit)
{
// asset alread set so use saved rules
$assetId = (int) $db->loadResult();
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
// check that there is a value
if ($db->getNumRows())
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
else
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
return $rules;
}
return $result;
// asset already set so use saved rules
$assetId = (int) $db->loadResult();
}
}
return JAccess::getAssetRules(0);
// get asset rules
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
elseif ($inherit)
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count($_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
// return filtered rules
return $rules;
}
}
return $result;
}
/**
@ -817,11 +824,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an json string
* Check if have an json string
*
* @input string The json string to check
* @input string The json string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkJson($string)
{
@ -834,11 +841,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an object with a length
* Check if have an object with a length
*
* @input object The object to check
* @input object The object to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkObject($object)
{
@ -850,11 +857,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an array with a length
* Check if have an array with a length
*
* @input array The array to check
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @returns bool/int number of items in array on success
**/
public static function checkArray($array, $removeEmptyString = false)
{
@ -878,11 +885,11 @@ abstract class ###Component###Helper
}
/**
* Check if have a string with a length
* Check if have a string with a length
*
* @input string The string to check
* @input string The string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkString($string)
{
@ -894,10 +901,10 @@ abstract class ###Component###Helper
}
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
* @returns bool true on success
**/
public static function isConnected()
{
@ -919,11 +926,11 @@ abstract class ###Component###Helper
}
/**
* Merge an array of array's
* Merge an array of array's
*
* @input array The arrays you would like to merge
* @input array The arrays you would like to merge
*
* @returns array on success
* @returns array on success
**/
public static function mergeArrays($arrays)
{
@ -949,11 +956,11 @@ abstract class ###Component###Helper
}
/**
* Shorten a string
* Shorten a string
*
* @input string The you would like to shorten
* @input string The you would like to shorten
*
* @returns string on success
* @returns string on success
**/
public static function shorten($string, $length = 40, $addTip = true)
{
@ -990,11 +997,11 @@ abstract class ###Component###Helper
}
/**
* Making strings safe (various ways)
* Making strings safe (various ways)
*
* @input string The you would like to make safe
* @input string The you would like to make safe
*
* @returns string on success
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
@ -1134,11 +1141,11 @@ abstract class ###Component###Helper
}
/**
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
*
* @input an int
* @returns a string
* @input an int
* @returns a string
**/
public static function numberToString($x)
{
@ -1225,9 +1232,9 @@ abstract class ###Component###Helper
}
/**
* Random Key
* Random Key
*
* @returns a string
* @returns a string
**/
public static function randomkey($size)
{

View File

@ -72,7 +72,7 @@ abstract class ###Component###Helper
}
/**
* Load the Component xml manifest.
* Load the Component xml manifest.
**/
public static function manifest()
{
@ -81,12 +81,12 @@ abstract class ###Component###Helper
}
/**
* Joomla version object
* Joomla version object
**/
protected static $JVersion;
/**
* set/get Joomla version
* set/get Joomla version
**/
public static function jVersion()
{
@ -99,7 +99,7 @@ abstract class ###Component###Helper
}
/**
* Load the Contributors details.
* Load the Contributors details.
**/
public static function getContributors()
{
@ -137,7 +137,7 @@ abstract class ###Component###Helper
}###HELP_SITE###
/**
* Get any component's model
* Get any component's model
**/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = '###Component###', $config = array())
{
@ -181,9 +181,9 @@ abstract class ###Component###Helper
}
/**
* Add to asset Table
* Add to asset Table
*/
public static function setAsset($id,$table)
public static function setAsset($id, $table, $inherit = true)
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_###component###');
@ -200,8 +200,6 @@ abstract class ###Component###Helper
if ($error)
{
$this->setError($error);
return false;
}
else
@ -217,7 +215,7 @@ abstract class ###Component###Helper
$asset->name = $name;
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_###component###',$table);
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
if ($rules instanceof JAccessRules)
{
$asset->rules = (string) $rules;
@ -245,55 +243,62 @@ abstract class ###Component###Helper
}
/**
* Gets the default asset Rules for a component/view.
* Gets the default asset Rules for a component/view.
*/
protected static function getDefaultAssetRules($component,$view)
protected static function getDefaultAssetRules($component, $view, $inherit = true)
{
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
if ($db->loadRowList())
// if new or inherited
$assetId = 0;
// Only get the actual item rules if not inheriting
if (!$inherit)
{
// asset alread set so use saved rules
$assetId = (int) $db->loadResult();
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
// check that there is a value
if ($db->getNumRows())
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
else
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
return $rules;
}
return $result;
// asset already set so use saved rules
$assetId = (int) $db->loadResult();
}
}
return JAccess::getAssetRules(0);
// get asset rules
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
elseif ($inherit)
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count($_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
// return filtered rules
return $rules;
}
}
return $result;
}
/**
@ -809,11 +814,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an json string
* Check if have an json string
*
* @input string The json string to check
* @input string The json string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkJson($string)
{
@ -826,11 +831,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an object with a length
* Check if have an object with a length
*
* @input object The object to check
* @input object The object to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkObject($object)
{
@ -842,11 +847,11 @@ abstract class ###Component###Helper
}
/**
* Check if have an array with a length
* Check if have an array with a length
*
* @input array The array to check
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @returns bool/int number of items in array on success
**/
public static function checkArray($array, $removeEmptyString = false)
{
@ -870,11 +875,11 @@ abstract class ###Component###Helper
}
/**
* Check if have a string with a length
* Check if have a string with a length
*
* @input string The string to check
* @input string The string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkString($string)
{
@ -886,10 +891,10 @@ abstract class ###Component###Helper
}
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
* @returns bool true on success
**/
public static function isConnected()
{
@ -911,11 +916,11 @@ abstract class ###Component###Helper
}
/**
* Merge an array of array's
* Merge an array of array's
*
* @input array The arrays you would like to merge
* @input array The arrays you would like to merge
*
* @returns array on success
* @returns array on success
**/
public static function mergeArrays($arrays)
{
@ -941,11 +946,11 @@ abstract class ###Component###Helper
}
/**
* Shorten a string
* Shorten a string
*
* @input string The you would like to shorten
* @input string The you would like to shorten
*
* @returns string on success
* @returns string on success
**/
public static function shorten($string, $length = 40, $addTip = true)
{
@ -982,11 +987,11 @@ abstract class ###Component###Helper
}
/**
* Making strings safe (various ways)
* Making strings safe (various ways)
*
* @input string The you would like to make safe
* @input string The you would like to make safe
*
* @returns string on success
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
@ -1126,11 +1131,11 @@ abstract class ###Component###Helper
}
/**
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
*
* @input an int
* @returns a string
* @input an int
* @returns a string
**/
public static function numberToString($x)
{
@ -1217,9 +1222,9 @@ abstract class ###Component###Helper
}
/**
* Random Key
* Random Key
*
* @returns a string
* @returns a string
**/
public static function randomkey($size)
{

View File

@ -3157,6 +3157,7 @@ class Get
if (isset($option2['operator']))
{
$option2['operator'] = $operatorArray[$option2['operator']];
$option2['state_key'] = $this->setPlaceholders($this->setDynamicValues($option2['state_key']), $this->placeholders);
$option2['key'] = $result->key;
}
else

View File

@ -4008,7 +4008,7 @@ abstract class ComponentbuilderHelper
}
/**
* Load the Component xml manifest.
* Load the Component xml manifest.
**/
public static function manifest()
{
@ -4017,12 +4017,12 @@ abstract class ComponentbuilderHelper
}
/**
* Joomla version object
* Joomla version object
**/
protected static $JVersion;
/**
* set/get Joomla version
* set/get Joomla version
**/
public static function jVersion()
{
@ -4035,7 +4035,7 @@ abstract class ComponentbuilderHelper
}
/**
* Load the Contributors details.
* Load the Contributors details.
**/
public static function getContributors()
{
@ -4145,7 +4145,7 @@ abstract class ComponentbuilderHelper
}
/**
* Configure the Linkbar.
* Configure the Linkbar.
**/
public static function addSubmenu($submenu)
{
@ -4911,7 +4911,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get any component's model
* Get any component's model
**/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Componentbuilder', $config = array())
{
@ -4955,9 +4955,9 @@ abstract class ComponentbuilderHelper
}
/**
* Add to asset Table
* Add to asset Table
*/
public static function setAsset($id,$table)
public static function setAsset($id, $table, $inherit = true)
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_componentbuilder');
@ -4989,7 +4989,7 @@ abstract class ComponentbuilderHelper
$asset->name = $name;
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_componentbuilder',$table);
$rules = self::getDefaultAssetRules('com_componentbuilder', $table, $inherit);
if ($rules instanceof JAccessRules)
{
$asset->rules = (string) $rules;
@ -5017,55 +5017,62 @@ abstract class ComponentbuilderHelper
}
/**
* Gets the default asset Rules for a component/view.
* Gets the default asset Rules for a component/view.
*/
protected static function getDefaultAssetRules($component,$view)
protected static function getDefaultAssetRules($component, $view, $inherit = true)
{
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
if ($db->loadRowList())
// if new or inherited
$assetId = 0;
// Only get the actual item rules if not inheriting
if (!$inherit)
{
// asset alread set so use saved rules
$assetId = (int) $db->loadResult();
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
// check that there is a value
if ($db->getNumRows())
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
else
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
return $rules;
}
return $result;
// asset already set so use saved rules
$assetId = (int) $db->loadResult();
}
}
return JAccess::getAssetRules(0);
// get asset rules
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
elseif ($inherit)
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count($_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
// return filtered rules
return $rules;
}
}
return $result;
}
/**
@ -5234,11 +5241,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an json string
* Check if have an json string
*
* @input string The json string to check
* @input string The json string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkJson($string)
{
@ -5251,11 +5258,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an object with a length
* Check if have an object with a length
*
* @input object The object to check
* @input object The object to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkObject($object)
{
@ -5267,11 +5274,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an array with a length
* Check if have an array with a length
*
* @input array The array to check
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @returns bool/int number of items in array on success
**/
public static function checkArray($array, $removeEmptyString = false)
{
@ -5295,11 +5302,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have a string with a length
* Check if have a string with a length
*
* @input string The string to check
* @input string The string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkString($string)
{
@ -5311,10 +5318,10 @@ abstract class ComponentbuilderHelper
}
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
* @returns bool true on success
**/
public static function isConnected()
{
@ -5336,11 +5343,11 @@ abstract class ComponentbuilderHelper
}
/**
* Merge an array of array's
* Merge an array of array's
*
* @input array The arrays you would like to merge
* @input array The arrays you would like to merge
*
* @returns array on success
* @returns array on success
**/
public static function mergeArrays($arrays)
{
@ -5366,11 +5373,11 @@ abstract class ComponentbuilderHelper
}
/**
* Shorten a string
* Shorten a string
*
* @input string The you would like to shorten
* @input string The you would like to shorten
*
* @returns string on success
* @returns string on success
**/
public static function shorten($string, $length = 40, $addTip = true)
{
@ -5407,11 +5414,11 @@ abstract class ComponentbuilderHelper
}
/**
* Making strings safe (various ways)
* Making strings safe (various ways)
*
* @input string The you would like to make safe
* @input string The you would like to make safe
*
* @returns string on success
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
@ -5551,11 +5558,11 @@ abstract class ComponentbuilderHelper
}
/**
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
*
* @input an int
* @returns a string
* @input an int
* @returns a string
**/
public static function numberToString($x)
{
@ -5642,9 +5649,9 @@ abstract class ComponentbuilderHelper
}
/**
* Random Key
* Random Key
*
* @returns a string
* @returns a string
**/
public static function randomkey($size)
{

View File

@ -3604,7 +3604,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_NEW="A New Custom Code"
COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_JCB_PLACEHOLDER_DESCRIPTION="<p><span id='jcb-placeholder'><code>[save to see placeholder]</code></span><br />You can also pass values to this code like this: <span id='jcb-placeholder-arg'><code>[save to see placeholder trick]</code></span></p>
<p>Those values will be replace placeholders called args. These placeholders are zero based and should look like this: [[[arg0]]], [[[arg1]]] ... as many as you like. If you use 5 args in your code, you must always pass 5 values, since they are zero based your fifth arg will look like this [[[arg4]]]</p>
<p>To use the following <code>[ ] , + =</code> in your string being passed, use the following: <code>[</code> <b style=&quot;font-size: large;&quot;>&#8658;</b> <code>&amp;#91;</code>; <code>]</code> <b style=&quot;font-size: large;&quot;>&#8658;</b> <code>&amp;#93;</code>; <code>,</code> <b style=&quot;font-size: large;&quot;>&#8658;</b> <code>&amp;#44;</code>; <code>+</code> <b style=&quot;font-size: large;&quot;>&#8658;</b> <code>&amp;#43;</code>; <code>=</code> <b style=&quot;font-size: large;&quot;>&#8658;</b> <code>&amp;#61;</code></p>
<p>Please note that you can not use this placeholder in other custom code views, but in all other custom code areas in JCB found in other views like the admin, site and custom admin views.<br />Another important note, all code with args will not be reversed updated from the changes in the editor out side of JCB at this time, since that will remove all the arg placeholders this means you will only be able to update the code here in the JCB UI.</p><small>This note will change once we have resolved these limitations.</small>"
<p>Please note <em>THAT YOU CAN NOW</em> use this placeholder in other custom code views, just not in <b>Hash (automation)</b> custom code from the IDE, and not in it self, enjoy!<br />Another important note, all code with args will not be reversed updated from the changes in the editor out side of JCB at this time, since that will remove all the arg placeholders this means you will only be able to update the code here in the JCB UI.</p><small>This note will change once we have resolved these limitations.</small>"
COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_JCB_PLACEHOLDER_LABEL="You can use this code in any JCB code area, simply add this PlaceHolder."
COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="<div class='form-horizontal'><div class='span6'>
<h1>Understand how the placeholders work in (IDE)</h1>

View File

@ -1344,10 +1344,10 @@
name="icomoon"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICOMOON_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICOMOON_DESCRIPTION"
class="list_class fieldMedium"
class="list_class fieldMedium icomoon342"
multiple="false"
required="false"
default="">
onchange="getIconImage(this);">
<!-- Option Set. -->
<option value="joomla">
COM_COMPONENTBUILDER_ADMIN_VIEW_JOOMLA</option>

View File

@ -106,7 +106,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION"
default=""
default="[{&quot;submenu&quot;:&quot;1&quot;,&quot;checkin&quot;:&quot;1&quot;,&quot;history&quot;:&quot;1&quot;,&quot;access&quot;:&quot;1&quot;,&quot;port&quot;:&quot;1&quot;}]"
icon="list"
min="1">
<form hidden="true" name="list_addadmin_views_modal" repeat="true">
@ -128,10 +128,10 @@
name="icomoon"
label="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ICOMOON_LABEL"
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ICOMOON_DESCRIPTION"
class="list_class fieldMedium"
class="list_class fieldMedium icomoon342"
multiple="false"
required="false"
default="">
onchange="getIconImage(this);">
<!-- Option Set. -->
<option value="joomla">
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_JOOMLA</option>

View File

@ -126,10 +126,10 @@
name="icomoon"
label="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ICOMOON_LABEL"
description="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ICOMOON_DESCRIPTION"
class="list_class fieldMedium"
class="list_class fieldMedium icomoon342"
multiple="false"
required="false"
default="">
onchange="getIconImage(this);">
<!-- Option Set. -->
<option value="joomla">
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_JOOMLA</option>

View File

@ -680,10 +680,10 @@
name="icomoon"
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICOMOON_LABEL"
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICOMOON_DESCRIPTION"
class="list_class fieldMedium"
class="list_class fieldMedium icomoon342"
multiple="false"
required="false"
default="">
onchange="getIconImage(this);">
<!-- Option Set. -->
<option value="joomla">
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JOOMLA</option>

View File

@ -730,10 +730,10 @@
name="icomoon"
label="COM_COMPONENTBUILDER_SITE_VIEW_ICOMOON_LABEL"
description="COM_COMPONENTBUILDER_SITE_VIEW_ICOMOON_DESCRIPTION"
class="list_class fieldMedium"
class="list_class fieldMedium icomoon342"
multiple="false"
required="false"
default="">
onchange="getIconImage(this);">
<!-- Option Set. -->
<option value="joomla">
COM_COMPONENTBUILDER_SITE_VIEW_JOOMLA</option>

View File

@ -699,31 +699,6 @@ jQuery('#adminForm').on('change', '#jform_add_custom_button',function (e)
<?php $fieldNrs = range(1,7,1); ?>
<?php foreach($fieldNrs as $nr): ?>jQuery('#jform_custom_button_modal').on('change', 'select[name="icomoon-<?php echo $nr; ?>"]',function (e) {
// update the icon if changed
var vala_<?php echo $nr; ?> = jQuery('select[name="icomoon-<?php echo $nr; ?>"] option:selected').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
jQuery(document).ready(function() {
jQuery('input.form-field-repeatable').on('row-add', function (e) {
// show the icon if set
var vala_<?php echo $nr; ?> = jQuery('#jform_custom_button_fields_icomoon-<?php echo $nr; ?>').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>
<?php $numberAddtables = range(0, count( (array) $this->item->addtables) + 3, 1);?>
// for the values already set
@ -782,4 +757,22 @@ jQuery(document).ready( function($) {
$(".loading-dots").text(dots);
} , 500);
});
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
getIconImage(jQuery(row).find('.icomoon342'));
});
});
function getIconImage(field) {
// get the ID
var id = jQuery(field).attr('id');
// remove old one
jQuery('#image_'+id).remove();
// get value
var value = jQuery('#'+id).val();
// build new one
var span = '<span id="image_'+id+'" class="icon-'+value+'" style="position: absolute; top: 8px; right: -20px;"></span>';
// add the icon
jQuery('#'+id+'_chzn').append(span);
}
</script>

View File

@ -110,29 +110,32 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $fieldNrs = range(1,50,1); ?>
<?php foreach($fieldNrs as $nr): ?>jQuery('#jform_addadmin_views_modal').on('change', 'select[name="icomoon-<?php echo $nr; ?>"]',function (e) {
// update the icon if changed
var vala_<?php echo $nr; ?> = jQuery('select[name="icomoon-<?php echo $nr; ?>"] option:selected').val();
// build new span
var span = '<span id="icon_addadmin_views_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_addadmin_views_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_addadmin_views_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
var group_key = jQuery(row).context.dataset.group;
jQuery(row).find('#jform_addadmin_views__' + group_key + '__submenu').prop('checked', true);
jQuery(row).find('#jform_addadmin_views__' + group_key + '__checkin').prop('checked', true);
jQuery(row).find('#jform_addadmin_views__' + group_key + '__history').prop('checked', true);
jQuery(row).find('#jform_addadmin_views__' + group_key + '__access').prop('checked', true);
jQuery(row).find('#jform_addadmin_views__' + group_key + '__port').prop('checked', true);
})
});
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
getIconImage(jQuery(row).find('.icomoon342'));
});
});
jQuery(document).ready(function() {
jQuery('input.form-field-repeatable').on('row-add', function (e) {
// show the icon if set
var vala_<?php echo $nr; ?> = jQuery('#jform_addadmin_views_fields_icomoon-<?php echo $nr; ?>').val();
// build new span
var span = '<span id="icon_addadmin_views_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
function getIconImage(field) {
// get the ID
var id = jQuery(field).attr('id');
// remove old one
jQuery('#icon_addadmin_views_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_addadmin_views_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>
jQuery('#image_'+id).remove();
// get value
var value = jQuery('#'+id).val();
// build new one
var span = '<span id="image_'+id+'" class="icon-'+value+'" style="position: absolute; top: 8px; right: -20px;"></span>';
// add the icon
jQuery('#'+id+'_chzn').append(span);
}
</script>

View File

@ -110,29 +110,22 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $fieldNrs = range(1,50,1); ?>
<?php foreach($fieldNrs as $nr): ?>jQuery('#jform_addcustom_admin_views_modal').on('change', 'select[name="icomoon-<?php echo $nr; ?>"]',function (e) {
// update the icon if changed
var val_<?php echo $nr; ?> = jQuery('select[name="icomoon-<?php echo $nr; ?>"] option:selected').val();
// build new span
var span = '<span id="icon_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>" class="icon-'+val_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
getIconImage(jQuery(row).find('.icomoon342'));
});
});
jQuery(document).ready(function() {
jQuery('input.form-field-repeatable').on('row-add', function (e) {
// show the icon if set
var val_<?php echo $nr; ?> = jQuery('#jform_addcustom_admin_views_fields_icomoon-<?php echo $nr; ?>').val();
// build new span
var span = '<span id="icon_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>" class="icon-'+val_<?php echo $nr; ?>+'"></span>';
function getIconImage(field) {
// get the ID
var id = jQuery(field).attr('id');
// remove old one
jQuery('#icon_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_addcustom_admin_views_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>
jQuery('#image_'+id).remove();
// get value
var value = jQuery('#'+id).val();
// build new one
var span = '<span id="image_'+id+'" class="icon-'+value+'" style="position: absolute; top: 8px; right: -20px;"></span>';
// add the icon
jQuery('#'+id+'_chzn').append(span);
}
</script>

View File

@ -321,31 +321,6 @@ jQuery(function() {
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_main_get').closest('.input-append').addClass('jform_main_get_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
<?php $fieldNrs = range(1,7,1); ?>
<?php foreach($fieldNrs as $nr): ?>jQuery('#jform_custom_button_modal').on('change', 'select[name="icomoon-<?php echo $nr; ?>"]',function (e) {
// update the icon if changed
var vala_<?php echo $nr; ?> = jQuery('select[name="icomoon-<?php echo $nr; ?>"] option:selected').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
jQuery(document).ready(function() {
jQuery('input.form-field-repeatable').on('row-add', function (e) {
// show the icon if set
var vala_<?php echo $nr; ?> = jQuery('#jform_custom_button_fields_icomoon-<?php echo $nr; ?>').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
@ -422,4 +397,22 @@ jQuery(document).ready( function($) {
$(".loading-dots").text(dots);
} , 500);
});
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
getIconImage(jQuery(row).find('.icomoon342'));
});
});
function getIconImage(field) {
// get the ID
var id = jQuery(field).attr('id');
// remove old one
jQuery('#image_'+id).remove();
// get value
var value = jQuery('#'+id).val();
// build new one
var span = '<span id="image_'+id+'" class="icon-'+value+'" style="position: absolute; top: 8px; right: -20px;"></span>';
// add the icon
jQuery('#'+id+'_chzn').append(span);
}
</script>

View File

@ -339,31 +339,6 @@ jQuery(function() {
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_main_get').closest('.input-append').addClass('jform_main_get_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
<?php $fieldNrs = range(1,7,1); ?>
<?php foreach($fieldNrs as $nr): ?>jQuery('#jform_custom_button_modal').on('change', 'select[name="icomoon-<?php echo $nr; ?>"]',function (e) {
// update the icon if changed
var vala_<?php echo $nr; ?> = jQuery('select[name="icomoon-<?php echo $nr; ?>"] option:selected').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
jQuery(document).ready(function() {
jQuery('input.form-field-repeatable').on('row-add', function (e) {
// show the icon if set
var vala_<?php echo $nr; ?> = jQuery('#jform_custom_button_fields_icomoon-<?php echo $nr; ?>').val();
// build new span
var span = '<span id="icon_custom_button_fields_icomoon_<?php echo $nr; ?>" class="icon-'+vala_<?php echo $nr; ?>+'"></span>';
// remove old one
jQuery('#icon_custom_button_fields_icomoon_<?php echo $nr; ?>').remove();
// add the new icon
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
@ -440,4 +415,22 @@ jQuery(document).ready( function($) {
$(".loading-dots").text(dots);
} , 500);
});
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){
getIconImage(jQuery(row).find('.icomoon342'));
});
});
function getIconImage(field) {
// get the ID
var id = jQuery(field).attr('id');
// remove old one
jQuery('#image_'+id).remove();
// get value
var value = jQuery('#'+id).val();
// build new one
var span = '<span id="image_'+id+'" class="icon-'+value+'" style="position: absolute; top: 8px; right: -20px;"></span>';
// add the icon
jQuery('#'+id+'_chzn').append(span);
}
</script>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>27th November, 2018</creationDate>
<creationDate>19th December, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.9.7</version>
<version>2.9.8</version>
<description><![CDATA[
<h1>Component Builder (v.2.9.7)</h1>
<h1>Component Builder (v.2.9.8)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -548,10 +548,10 @@
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.9.7</version>
<version>2.9.8</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.9.7/JCB_v2.9.7.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.9.8/JCB_v2.9.8.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -5172,7 +5172,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.9.7 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.9.8 Was Successful! Let us know if anything is not working as expected.</h3>';
}
}

View File

@ -4057,7 +4057,7 @@ abstract class ComponentbuilderHelper
}
/**
* Load the Component xml manifest.
* Load the Component xml manifest.
**/
public static function manifest()
{
@ -4066,12 +4066,12 @@ abstract class ComponentbuilderHelper
}
/**
* Joomla version object
* Joomla version object
**/
protected static $JVersion;
/**
* set/get Joomla version
* set/get Joomla version
**/
public static function jVersion()
{
@ -4084,7 +4084,7 @@ abstract class ComponentbuilderHelper
}
/**
* Load the Contributors details.
* Load the Contributors details.
**/
public static function getContributors()
{
@ -4194,7 +4194,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get any component's model
* Get any component's model
**/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'Componentbuilder', $config = array())
{
@ -4238,9 +4238,9 @@ abstract class ComponentbuilderHelper
}
/**
* Add to asset Table
* Add to asset Table
*/
public static function setAsset($id,$table)
public static function setAsset($id, $table, $inherit = true)
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_componentbuilder');
@ -4257,8 +4257,6 @@ abstract class ComponentbuilderHelper
if ($error)
{
$this->setError($error);
return false;
}
else
@ -4274,7 +4272,7 @@ abstract class ComponentbuilderHelper
$asset->name = $name;
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_componentbuilder',$table);
$rules = self::getDefaultAssetRules('com_componentbuilder', $table, $inherit);
if ($rules instanceof JAccessRules)
{
$asset->rules = (string) $rules;
@ -4302,55 +4300,62 @@ abstract class ComponentbuilderHelper
}
/**
* Gets the default asset Rules for a component/view.
* Gets the default asset Rules for a component/view.
*/
protected static function getDefaultAssetRules($component,$view)
protected static function getDefaultAssetRules($component, $view, $inherit = true)
{
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
if ($db->loadRowList())
// if new or inherited
$assetId = 0;
// Only get the actual item rules if not inheriting
if (!$inherit)
{
// asset alread set so use saved rules
$assetId = (int) $db->loadResult();
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
// check that there is a value
if ($db->getNumRows())
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
else
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
return $rules;
}
return $result;
// asset already set so use saved rules
$assetId = (int) $db->loadResult();
}
}
return JAccess::getAssetRules(0);
// get asset rules
$result = JAccess::getAssetRules($assetId);
if ($result instanceof JAccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($view !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
elseif ($inherit)
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count($_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules($_result);
// return filtered rules
return $rules;
}
}
return $result;
}
/**
@ -4968,11 +4973,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an json string
* Check if have an json string
*
* @input string The json string to check
* @input string The json string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkJson($string)
{
@ -4985,11 +4990,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an object with a length
* Check if have an object with a length
*
* @input object The object to check
* @input object The object to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkObject($object)
{
@ -5001,11 +5006,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have an array with a length
* Check if have an array with a length
*
* @input array The array to check
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @returns bool/int number of items in array on success
**/
public static function checkArray($array, $removeEmptyString = false)
{
@ -5029,11 +5034,11 @@ abstract class ComponentbuilderHelper
}
/**
* Check if have a string with a length
* Check if have a string with a length
*
* @input string The string to check
* @input string The string to check
*
* @returns bool true on success
* @returns bool true on success
**/
public static function checkString($string)
{
@ -5045,10 +5050,10 @@ abstract class ComponentbuilderHelper
}
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
* @returns bool true on success
**/
public static function isConnected()
{
@ -5070,11 +5075,11 @@ abstract class ComponentbuilderHelper
}
/**
* Merge an array of array's
* Merge an array of array's
*
* @input array The arrays you would like to merge
* @input array The arrays you would like to merge
*
* @returns array on success
* @returns array on success
**/
public static function mergeArrays($arrays)
{
@ -5100,11 +5105,11 @@ abstract class ComponentbuilderHelper
}
/**
* Shorten a string
* Shorten a string
*
* @input string The you would like to shorten
* @input string The you would like to shorten
*
* @returns string on success
* @returns string on success
**/
public static function shorten($string, $length = 40, $addTip = true)
{
@ -5141,11 +5146,11 @@ abstract class ComponentbuilderHelper
}
/**
* Making strings safe (various ways)
* Making strings safe (various ways)
*
* @input string The you would like to make safe
* @input string The you would like to make safe
*
* @returns string on success
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
@ -5285,11 +5290,11 @@ abstract class ComponentbuilderHelper
}
/**
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
* Convert an integer into an English word string
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
*
* @input an int
* @returns a string
* @input an int
* @returns a string
**/
public static function numberToString($x)
{
@ -5376,9 +5381,9 @@ abstract class ComponentbuilderHelper
}
/**
* Random Key
* Random Key
*
* @returns a string
* @returns a string
**/
public static function randomkey($size)
{