Update master #1

Merged
root merged 49 commits from joomla/Component-Builder:master into master 2024-02-06 12:33:45 +00:00
1423 changed files with 164181 additions and 64533 deletions

View File

@ -1,24 +1,17 @@
Contributing to the Joomla Component Builder (JCB) Contributing to the Joomla Component Builder (JCB)
=============== ===============
You are welcome to submit a contribution for review and possible inclusion in the Joomla Component Builder but, before it will be accepted, we ask that you follow these simple steps: If you wish to submit a contribution for review and potential inclusion in the Joomla Component Builder (JCB), please follow these simple steps:
1) Please watch [these tutorials][Tutorials] 1) Open an issue on GitHub, and if possible, provide a fix and create a pull request (PR). Creating a PR automatically generates an issue so that you do not need to create one separately.
2) Open an issue on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue if you are creating a pull request. 2) Adhere to the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
3) Follow the [Joomla! Coding Standards][Standards]. 3) When filing an issue or opening a PR, provide a clear and concise title and description. The title should include a brief summary of the issue and reference to an open issue if possible. For example, Invalid Query in com_admin (Ref #1234) is sufficient. Additionally, provide a detailed description of the issue or PR, including what the problem is, what the PR is addressing, testing instructions, and environmental information such as PHP version and database driver and version, in case the issue is specific to certain environments.
4) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible. 4) Report security issues to the JCB! Core Team using the [Report security issues contact form](https://www.vdm.io/report-security-issues) instead of using public forums.
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
5) Report security issues to the JCB! Core Team using the [Report security issues contact form][Security]. Please do not use the public forums for security issues. Please be patient, as not all items will be immediately tested since all bug testing for the JCB is performed by volunteers. Additionally, be open to feedback regarding your code.
Please be patient as not all items will be tested immediately (remember, all bug testing for the JCB is done by volunteers) and be receptive to feedback about your code.
#### Branches #### Branches
PRs should usually be made to the `staging` branch as this contains the most recent version of the code. For PRs, submit to the staging branch as it contains the most up-to-date version of the code.
[Tutorials]: https://www.youtube.com/watch?v=lLOfx9YA7VQ&list=PLQRGFI8XZ_wsfz3NdKawCiYsALuZ-GhwJ
[Standards]: https://developer.joomla.org/coding-standards.html\
[Security]: http://joomlacomponentbuilder.com/report-security-issues

39
.github/SUPPORT.md vendored
View File

@ -1,27 +1,22 @@
Where can you get support and help? Where can you get support and help?
==================== ====================
+ [The JCB Tutorials][Tutorials] - [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+ [Hello World Tutorial][HelloWorld] - [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+ [The JCB! Wiki][Wiki] - [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+ [JCB Forum][forum] - [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+ [Report a Security Issue][Security] - [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+ [Community Complaint][Complaint] - [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+ [Open Issue On Github][Issue] ^^ - [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
- [Issues Stream](https://t.me/jcb_issues).
- [Updates](https://t.me/jcb_updates).
- [User Group](https://t.me/jcb_group).
- [Announcement](https://t.me/Joomla_component_builder).
- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
- [Security](https://www.vdm.io/report-security-issues).
Since JCB has become a community project [VDM.io][VDM] is **no longer solely responsible** for support. ^^ 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).
We have started a [**JCB forum**][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][Issue] over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines][guidelines].
[Tutorials]: https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE
[HelloWorld]: https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45
[Wiki]: https://git.vdm.dev/joomla/Component-Builder/wiki
[forum]: https://vdm.bz/jcb-forum
[Security]: http://joomlacomponentbuilder.com/report-security-issues
[Complaint]: http://joomlacomponentbuilder.com/community-complaint
[Issue]: https://git.vdm.dev/joomla/Component-Builder/issues
[VDM]: https://www.vdm.io/joomla-component-builder
[guidelines]: https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md

61
CHANGELOG.md Normal file
View File

@ -0,0 +1,61 @@
# v3.1.28
- Updates PHPSecLib.
- Fixed connection failure to remote server.
- Adds overriding of back-folder and git-folder on component level.
# v3.1.27
- Adds better remote repository management for the super power features.
- Fixes #1014 so that powers are added to components.
# v3.1.26
- Fixed changelog direction so newest changes is listed at top of the file.
- Finished the init function of super powers.
- Adds rest function inside super power.
- Adds super powers to all templates.
- Updates many helper class methods to now use the utility classes.
- Adds the `spl_autoload_register` method to the component entry file (as-well).
- Moved most methods from the compiler fields class to powers. #955
- Refactored many new builder classes from the registry class.
- Converted the Content class to two builder classes.
- Adds option to add additional templates to a module.
- Resolves #1002 by adding STRING instead of WORD.
- Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof
- Changed all CSS and JS to use `JHtml::_(` instead of `$this->document->` in compiler code.
- Adds option to turn jQuery off if UIKIT 3 is added.
- Adds option to auto write injection boilerplate code in Powers area.
- Adds option to auto write service provider boilerplate code in the Powers area.
- Improved the `getDynamicContent` method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead.
- Major stability improvements all over the new powers complier classes.
- New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB.
- Remember to update all plug-ins with this version update (use the package).
# v3.1.24
- Fix the update server #978 issue.
- Fixed the change log to load all entries, not just the last one.
- Fixed #983 so that database updates are created when adding a new adminview
- Moved a few builder arrays to the Compiler Registry
- Adds super powers to JCB
- Adds Gitea API library
- Improves Power filters
- Fix #991 to add the Utilities service class
- Adds Superpower Key (SPK) replacement feature
- Adds Superpower search (GREP) feature
- Adds Power Insert/Update Classes
- Fix #995 that all update sites are using the correct URL
# v3.1.19
- We fixed #972 so that custom code (in the header) will be added after the power namespaces
- We added a message to show when a server move failed
- We fixed the BaseConfig to not use '_' as separator
- We fixed the footable loading issue
- We removed the need for passing placeholders by reference
- We added the option to generate a CHANGELOG
- We fixed the server class to load new client if server details changed.
- We fixed the readme placeholder issue #978.
- We fixed the empty server url issue #978.
- Fixed Package import to now use the phplibsec version 3

View File

@ -1,5 +1,5 @@
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com)) # Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! 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.4) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.28) 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) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end. + 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. + [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. + [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) + 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](http://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. + Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump. + Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components. + Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component. + 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). + 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. + This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com). + Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder! + This and much much more are all possible with this component builder!
Get More Demo Content Get More Demo Content
==================== ====================
> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components. > You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)! ### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help? Where can you get support and help?
==================== ====================
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE) - [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7) - [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) - [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki) - [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+ [Forum](https://vdm.bz/jcb-forum) - [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues) - [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint) - [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^ - [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
- [Issues Stream](https://t.me/jcb_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. - [Updates](https://t.me/jcb_updates).
- [User Group](https://t.me/jcb_group).
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. - [Announcement](https://t.me/Joomla_component_builder).
- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
- [Security](https://www.vdm.io/report-security-issues).
^^ 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). ^^ 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).
@ -125,14 +129,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER! MAKING IT BETTER!
==================== ====================
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas. Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO TODO
====== ======
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com). - Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online. - Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this) - Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details # Build Details
@ -140,17 +144,17 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 9th July, 2022 + *Last Build*: 24th October, 2023
+ *Version*: 3.1.4 + *Version*: 3.1.28
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **311349** + *Line count*: **635155**
+ *Field count*: **2002** + *Field count*: **2047**
+ *File count*: **2050** + *File count*: **4731**
+ *Folder count*: **349** + *Folder count*: **436**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Contributors ## Contributors

View File

@ -1,5 +1,5 @@
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com)) # Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! 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.4) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.28) 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) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end. + 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. + [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. + [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) + 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](http://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. + Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump. + Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components. + Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component. + 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). + 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. + This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com). + Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder! + This and much much more are all possible with this component builder!
Get More Demo Content Get More Demo Content
==================== ====================
> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components. > You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)! ### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help? Where can you get support and help?
==================== ====================
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE) - [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7) - [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) - [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki) - [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+ [Forum](https://vdm.bz/jcb-forum) - [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues) - [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint) - [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^ - [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
- [Issues Stream](https://t.me/jcb_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. - [Updates](https://t.me/jcb_updates).
- [User Group](https://t.me/jcb_group).
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. - [Announcement](https://t.me/Joomla_component_builder).
- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
- [Security](https://www.vdm.io/report-security-issues).
^^ 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). ^^ 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).
@ -125,14 +129,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER! MAKING IT BETTER!
==================== ====================
Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas. Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO TODO
====== ======
- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com). - Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online. - Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this) - Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details # Build Details
@ -140,17 +144,17 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 9th July, 2022 + *Last Build*: 24th October, 2023
+ *Version*: 3.1.4 + *Version*: 3.1.28
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **311349** + *Line count*: **635155**
+ *Field count*: **2002** + *Field count*: **2047**
+ *File count*: **2050** + *File count*: **4731**
+ *Folder count*: **349** + *Folder count*: **436**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Contributors ## Contributors

View File

@ -19,7 +19,6 @@
<action name="admin_view.access" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC" /> <action name="admin_view.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.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.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.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.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" /> <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.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.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.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.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.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" /> <action name="custom_admin_view.export" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT_DESC" />
@ -485,6 +483,8 @@
<action name="placeholder.export" title="COM_COMPONENTBUILDER_PLACEHOLDERS_EXPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_EXPORT_DESC" /> <action name="placeholder.export" title="COM_COMPONENTBUILDER_PLACEHOLDERS_EXPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_EXPORT_DESC" />
<action name="placeholder.import" title="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT_DESC" /> <action name="placeholder.import" title="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT_DESC" />
<action name="placeholder.submenu" title="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU" description="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU_DESC" /> <action name="placeholder.submenu" title="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU" description="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU_DESC" />
<action name="power.init" title="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC" />
<action name="power.reset" title="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC" />
<action name="power.run_expansion" title="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC" /> <action name="power.run_expansion" title="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC" />
<action name="power.access" title="COM_COMPONENTBUILDER_POWERS_ACCESS" description="COM_COMPONENTBUILDER_POWERS_ACCESS_DESC" /> <action name="power.access" title="COM_COMPONENTBUILDER_POWERS_ACCESS" description="COM_COMPONENTBUILDER_POWERS_ACCESS_DESC" />
<action name="power.batch" title="COM_COMPONENTBUILDER_POWERS_BATCH_USE" description="COM_COMPONENTBUILDER_POWERS_BATCH_USE_DESC" /> <action name="power.batch" title="COM_COMPONENTBUILDER_POWERS_BATCH_USE" description="COM_COMPONENTBUILDER_POWERS_BATCH_USE_DESC" />
@ -498,6 +498,10 @@
<action name="power.edit.state" title="COM_COMPONENTBUILDER_POWERS_EDIT_STATE" description="COM_COMPONENTBUILDER_POWERS_EDIT_STATE_DESC" /> <action name="power.edit.state" title="COM_COMPONENTBUILDER_POWERS_EDIT_STATE" description="COM_COMPONENTBUILDER_POWERS_EDIT_STATE_DESC" />
<action name="power.version" title="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION_DESC" /> <action name="power.version" title="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION_DESC" />
<action name="power.submenu" title="COM_COMPONENTBUILDER_POWERS_SUBMENU" description="COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC" /> <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.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" /> <action name="server.batch" title="COM_COMPONENTBUILDER_SERVERS_BATCH_USE" description="COM_COMPONENTBUILDER_SERVERS_BATCH_USE_DESC" />
<action name="server.create" title="COM_COMPONENTBUILDER_SERVERS_CREATE" description="COM_COMPONENTBUILDER_SERVERS_CREATE_DESC" /> <action name="server.create" title="COM_COMPONENTBUILDER_SERVERS_CREATE" description="COM_COMPONENTBUILDER_SERVERS_CREATE_DESC" />
@ -515,7 +519,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.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.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.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.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.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" /> <action name="site_view.export" title="COM_COMPONENTBUILDER_SITE_VIEWS_EXPORT" description="COM_COMPONENTBUILDER_SITE_VIEWS_EXPORT_DESC" />

View File

@ -0,0 +1,40 @@
/**
* @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
*/
/* 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

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
View 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 +
'&regex_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 +
'&regex_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 &amp; van Zonneveld'
// example 2: htmlentities("foo'bar","ENT_QUOTES")
// returns 2: 'foo&#039;bar'
const hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle)
string = string === null ? '' : string + ''
if (!hashMap) {
return false
}
if (quoteStyle && quoteStyle === 'ENT_QUOTES') {
hashMap["'"] = '&#039;'
}
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: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
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'] = '&amp;'
if (useTable === 'HTML_ENTITIES') {
entities['160'] = '&nbsp;'
entities['161'] = '&iexcl;'
entities['162'] = '&cent;'
entities['163'] = '&pound;'
entities['164'] = '&curren;'
entities['165'] = '&yen;'
entities['166'] = '&brvbar;'
entities['167'] = '&sect;'
entities['168'] = '&uml;'
entities['169'] = '&copy;'
entities['170'] = '&ordf;'
entities['171'] = '&laquo;'
entities['172'] = '&not;'
entities['173'] = '&shy;'
entities['174'] = '&reg;'
entities['175'] = '&macr;'
entities['176'] = '&deg;'
entities['177'] = '&plusmn;'
entities['178'] = '&sup2;'
entities['179'] = '&sup3;'
entities['180'] = '&acute;'
entities['181'] = '&micro;'
entities['182'] = '&para;'
entities['183'] = '&middot;'
entities['184'] = '&cedil;'
entities['185'] = '&sup1;'
entities['186'] = '&ordm;'
entities['187'] = '&raquo;'
entities['188'] = '&frac14;'
entities['189'] = '&frac12;'
entities['190'] = '&frac34;'
entities['191'] = '&iquest;'
entities['192'] = '&Agrave;'
entities['193'] = '&Aacute;'
entities['194'] = '&Acirc;'
entities['195'] = '&Atilde;'
entities['196'] = '&Auml;'
entities['197'] = '&Aring;'
entities['198'] = '&AElig;'
entities['199'] = '&Ccedil;'
entities['200'] = '&Egrave;'
entities['201'] = '&Eacute;'
entities['202'] = '&Ecirc;'
entities['203'] = '&Euml;'
entities['204'] = '&Igrave;'
entities['205'] = '&Iacute;'
entities['206'] = '&Icirc;'
entities['207'] = '&Iuml;'
entities['208'] = '&ETH;'
entities['209'] = '&Ntilde;'
entities['210'] = '&Ograve;'
entities['211'] = '&Oacute;'
entities['212'] = '&Ocirc;'
entities['213'] = '&Otilde;'
entities['214'] = '&Ouml;'
entities['215'] = '&times;'
entities['216'] = '&Oslash;'
entities['217'] = '&Ugrave;'
entities['218'] = '&Uacute;'
entities['219'] = '&Ucirc;'
entities['220'] = '&Uuml;'
entities['221'] = '&Yacute;'
entities['222'] = '&THORN;'
entities['223'] = '&szlig;'
entities['224'] = '&agrave;'
entities['225'] = '&aacute;'
entities['226'] = '&acirc;'
entities['227'] = '&atilde;'
entities['228'] = '&auml;'
entities['229'] = '&aring;'
entities['230'] = '&aelig;'
entities['231'] = '&ccedil;'
entities['232'] = '&egrave;'
entities['233'] = '&eacute;'
entities['234'] = '&ecirc;'
entities['235'] = '&euml;'
entities['236'] = '&igrave;'
entities['237'] = '&iacute;'
entities['238'] = '&icirc;'
entities['239'] = '&iuml;'
entities['240'] = '&eth;'
entities['241'] = '&ntilde;'
entities['242'] = '&ograve;'
entities['243'] = '&oacute;'
entities['244'] = '&ocirc;'
entities['245'] = '&otilde;'
entities['246'] = '&ouml;'
entities['247'] = '&divide;'
entities['248'] = '&oslash;'
entities['249'] = '&ugrave;'
entities['250'] = '&uacute;'
entities['251'] = '&ucirc;'
entities['252'] = '&uuml;'
entities['253'] = '&yacute;'
entities['254'] = '&thorn;'
entities['255'] = '&yuml;'
}
if (useQuoteStyle !== 'ENT_NOQUOTES') {
entities['34'] = '&quot;'
}
if (useQuoteStyle === 'ENT_QUOTES') {
entities['39'] = '&#39;'
}
entities['60'] = '&lt;'
entities['62'] = '&gt;'
// 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, '+')
}

View File

@ -17,8 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController; ###IMPORT_CONTROLLER_HEADER###
use Joomla\Utilities\ArrayHelper;
/** /**
* ###Component### Import Base Controller * ###Component### Import Base Controller

View File

@ -17,8 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController; ###IMPORT_CUSTOM_CONTROLLER_HEADER###
use Joomla\Utilities\ArrayHelper;
/** /**
* ###Component### ###View### Base Controller * ###Component### ###View### Base Controller

View File

@ -17,13 +17,9 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\BaseDatabaseModel; ###IMPORT_MODEL_HEADER###
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
/** /***
* ###Component### Import Base Database Model * ###Component### Import Base Database Model
*/ */
class ###Component###ModelImport extends BaseDatabaseModel class ###Component###ModelImport extends BaseDatabaseModel

View File

@ -17,11 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\BaseDatabaseModel; ###IMPORT_CUSTOM_MODEL_HEADER###
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
/** /**
* ###Component### ###View### Base Database Model * ###Component### ###View### Base Database Model

View File

@ -0,0 +1 @@
###CHANGELOG###

View File

@ -47,7 +47,7 @@ abstract class ###Component###Helper
if (!isset(self::$composer[$target])) if (!isset(self::$composer[$target]))
{ {
// get the function name // get the function name
$functionName = self::safeString('compose' . $target); $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target);
// check if method exist // check if method exist
if (method_exists(__CLASS__, $functionName)) if (method_exists(__CLASS__, $functionName))
{ {
@ -78,7 +78,7 @@ abstract class ###Component###Helper
public static function jVersion() public static function jVersion()
{ {
// check if set // check if set
if (!self::checkObject(self::$JVersion)) if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{ {
self::$JVersion = new JVersion(); self::$JVersion = new JVersion();
} }
@ -116,8 +116,8 @@ abstract class ###Component###Helper
$link_front = ''; $link_front = '';
$link_back = ''; $link_back = '';
} }
$contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
} }
} }
return $contributors; return $contributors;
@ -145,46 +145,18 @@ abstract class ###Component###Helper
* @param string $main The component in which the table is found * @param string $main The component in which the table is found
* *
* @return mix string/int/float * @return mix string/int/float
* * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...);
*/ */
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{ {
if(!$where) return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
{ $table,
$where = JFactory::getUser()->id; $where,
} $whereString,
// Get a db connection. $what,
$db = JFactory::getDbo(); $operator,
// Create a new query object. $main
$query = $db->getQuery(true); );
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
}
elseif (is_string($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
} }
/** /**
@ -199,110 +171,38 @@ abstract class ###Component###Helper
* @param bool $unique The switch to return a unique array * @param bool $unique The switch to return a unique array
* *
* @return array * @return array
* * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...);
*/ */
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{ {
if(!$where) return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(
{ $table,
$where = JFactory::getUser()->id; $where,
} $whereString,
$what,
if (!self::checkArray($where) && $where > 0) $operator,
{ $main,
$where = array($where); $unique
} );
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
// add strings to array search
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
{
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
}
else
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if ($unique)
{
return array_unique($db->loadColumn());
}
return $db->loadColumn();
}
}
return false;
} }
/**
* Convert a json object to a string
*
* @input string $value The json string to convert
*
* @returns a string
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...);
*/
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{ {
// do some table foot work return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
$external = false; $value,
if (strpos($table, '#__') !== false) $sperator,
{ $table,
$external = true; $id,
$table = str_replace('#__', '', $table); $name
} );
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (self::checkArray($result))
{
if (self::checkString($table))
{
$names = array();
foreach ($result as $val)
{
if ($external)
{
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $_name;
}
}
else
{
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $_name;
}
}
}
if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
}
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
}
return $value;
} }
public static function isPublished($id,$type) public static function isPublished($id,$type)
@ -360,7 +260,7 @@ abstract class ###Component###Helper
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
{ {
// load the user if not given // load the user if not given
if (!self::checkObject($user)) if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{ {
// get the user object // get the user object
$user = JFactory::getUser(); $user = JFactory::getUser();
@ -368,10 +268,10 @@ abstract class ###Component###Helper
// load the JObject // load the JObject
$result = new JObject; $result = new JObject;
// make view name safe (just incase) // make view name safe (just incase)
$view = self::safeString($view); $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (self::checkString($views)) if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{ {
$views = self::safeString($views); $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActionsFromFile( $actions = JAccess::getActionsFromFile(
@ -384,9 +284,9 @@ abstract class ###Component###Helper
return $result; return $result;
} }
// get created by if not found // get created by if not found
if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id))
{ {
$record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component);
} }
// set actions only set in component settings // set actions only set in component settings
$componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export');
@ -395,12 +295,12 @@ abstract class ###Component###Helper
if ($target) if ($target)
{ {
// convert to an array // convert to an array
if (self::checkString($target)) if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target))
{ {
$target = array($target); $target = array($target);
} }
// check if we are good to go // check if we are good to go
if (self::checkArray($target)) if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target))
{ {
$checkTarget = true; $checkTarget = true;
} }
@ -421,7 +321,7 @@ abstract class ###Component###Helper
// set area // set area
$area = 'comp'; $area = 'comp';
// check if the record has an ID and the action is item related (not a component action) // check if the record has an ID and the action is item related (not a component action)
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
(strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false))
{ {
// we are in item // we are in item
@ -454,7 +354,7 @@ abstract class ###Component###Helper
} }
} }
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0)
{ {
// we are in item // we are in item
$area = 'category'; $area = 'category';
@ -548,13 +448,13 @@ abstract class ###Component###Helper
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
{ {
// fix the name // fix the name
$name = self::safeString($name); $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models // full path to models
$fullPathModels = $path . '/models'; $fullPathModels = $path . '/models';
// load the model file // load the model file
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded // make sure the table path is loaded
if (!isset($config['table_path']) || !self::checkString($config['table_path'])) if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{ {
// This is the JCB default path to tables in Joomla 3.x // This is the JCB default path to tables in Joomla 3.x
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
@ -717,35 +617,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/ */
public static function xmlAppend(&$xml, $node) public static function xmlAppend(&$xml, $node)
{ {
if (!$node) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
} }
/** /**
@ -754,16 +631,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject * @param string $comment The comment to inject
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/ */
public static function xmlComment(&$xml, $comment) public static function xmlComment(&$xml, $comment)
{ {
$domXML = dom_import_simplexml($xml); Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
} }
/** /**
@ -773,14 +646,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element * @param array $attributes The attributes to apply to the XML element
* *
* @return null * @return null
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/ */
public static function xmlAddAttributes(&$xml, $attributes = array()) public static function xmlAddAttributes(&$xml, $attributes = array())
{ {
foreach ($attributes as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
{
$xml->addAttribute($key, $value);
}
} }
/** /**
@ -790,16 +660,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return void * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/ */
public static function xmlAddOptions(&$xml, $options = array()) public static function xmlAddOptions(&$xml, $options = array())
{ {
foreach ($options as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
} }
/** /**
@ -810,28 +675,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/ */
public static function getFieldObject(&$attributes, $default = '', $options = null) public static function getFieldObject(&$attributes, $default = '', $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
} }
/** /**
@ -841,27 +689,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/ */
public static function getFieldXML(&$attributes, $options = null) public static function getFieldXML(&$attributes, $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
} }
/** /**
@ -885,17 +717,17 @@ abstract class ###Component###Helper
// button attributes // button attributes
$buttonAttributes = array( $buttonAttributes = array(
'type' => 'radio', 'type' => 'radio',
'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button',
'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'class' => 'btn-group', 'class' => 'btn-group',
'filter' => 'INT', 'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0); 'default' => isset($args[2]) ? (int) $args[2] : 0);
// set the button options // set the button options
$buttonOptions = array( $buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO');
// return the input // return the input
return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
} }
/** /**
@ -904,15 +736,11 @@ abstract class ###Component###Helper
* @input string The json string to check * @input string The json string to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
*/ */
public static function checkJson($string) public static function checkJson($string)
{ {
if (self::checkString($string)) return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
} }
/** /**
@ -921,14 +749,11 @@ abstract class ###Component###Helper
* @input object The object to check * @input object The object to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
*/ */
public static function checkObject($object) public static function checkObject($object)
{ {
if (isset($object) && is_object($object)) return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
{
return count((array)$object) > 0;
}
return false;
} }
/** /**
@ -937,26 +762,11 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
*/ */
public static function checkArray($array, $removeEmptyString = false) public static function checkArray($array, $removeEmptyString = false)
{ {
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0) return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
{
// also make sure the empty strings are removed
if ($removeEmptyString)
{
foreach ($array as $key => $string)
{
if (empty($string))
{
unset($array[$key]);
}
}
return self::checkArray($array, false);
}
return $nr;
}
return false;
} }
/** /**
@ -965,14 +775,11 @@ abstract class ###Component###Helper
* @input string The string to check * @input string The string to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
*/ */
public static function checkString($string) public static function checkString($string)
{ {
if (isset($string) && is_string($string) && strlen($string) > 0) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
{
return true;
}
return false;
} }
/** /**
@ -1006,22 +813,11 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
*/ */
public static function mergeArrays($arrays) public static function mergeArrays($arrays)
{ {
if(self::checkArray($arrays)) return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
{
$arrayBuket = array();
foreach ($arrays as $array)
{
if (self::checkArray($array))
{
$arrayBuket = array_merge($arrayBuket, $array);
}
}
return $arrayBuket;
}
return false;
} }
// typo sorry! // typo sorry!
@ -1036,39 +832,11 @@ abstract class ###Component###Helper
* @input string The you would like to shorten * @input string The you would like to shorten
* *
* @returns string on success * @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
*/ */
public static function shorten($string, $length = 40, $addTip = true) public static function shorten($string, $length = 40, $addTip = true)
{ {
if (self::checkString($string)) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip);
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
for (; $last_word < $words_count; ++$last_word)
{
$word_length += strlen($words[$last_word]);
if ($word_length > $length)
{
break;
}
}
$newString = implode(array_slice($words, 0, $last_word));
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
{
return trim($newString).'...';
}
}
return $string;
} }
/** /**
@ -1077,157 +845,61 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
*/ */
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{ {
if ($replaceNumbers === true) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(
{ $string,
// remove all numbers and replace with english text version (works well only up to millions) $type,
$string = self::replaceNumbers($string); $spacer,
} $replaceNumbers,
// 0nly continue if we have a string $keepOnlyCharacters
if (self::checkString($string)) );
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
// Transliterate string
$string = self::transliterate($string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
} }
/**
* Convert none English strings to code usable string
*
* @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
*/
public static function transliterate($string) public static function transliterate($string)
{ {
// set tag only once return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
if (!self::checkString(self::$langTag))
{
// get global value
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
}
// Transliterate on the language requested
$lang = Language::getInstance(self::$langTag);
return $lang->transliterate($string);
} }
/**
* make sure a string is HTML save
*
* @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
*/
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{ {
if (self::checkString($var)) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(
{ $var,
$filter = new JFilterInput(); $charset,
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML'); $shorten,
if ($shorten) $length
{ );
return self::shorten($string,$length);
}
return $string;
}
else
{
return '';
}
}###HELPER_LICENSE_LOCK### }###HELPER_LICENSE_LOCK###
/**
* Convert all int in a string to an English word string
*
* @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
*/
public static function replaceNumbers($string) public static function replaceNumbers($string)
{ {
// set numbers array return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
$numbers = array();
// first get all numbers
preg_match_all('!\d+!', $string, $numbers);
// check if we have any numbers
if (isset($numbers[0]) && self::checkArray($numbers[0]))
{
foreach ($numbers[0] as $number)
{
$searchReplace[$number] = self::numberToString((int)$number);
}
// now replace numbers in string
$string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
// check if we missed any, strange if we did.
return self::replaceNumbers($string);
}
// return the string with no numbers remaining.
return $string;
} }
/** /**
@ -1236,107 +908,21 @@ abstract class ###Component###Helper
* *
* @input an int * @input an int
* @returns a string * @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/ */
public static function numberToString($x) public static function numberToString($x)
{ {
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven", return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
"eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
"nineteen", "twenty", 30 => "thirty", 40 => "forty",
50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
90 => "ninety" );
if(!is_numeric($x))
{
$w = $x;
}
elseif(fmod($x, 1) != 0)
{
$w = $x;
}
else
{
if($x < 0)
{
$w = 'minus ';
$x = -$x;
}
else
{
$w = '';
// ... now $x is a non-negative integer.
}
if($x < 21) // 0 to 20
{
$w .= $nwords[$x];
}
elseif($x < 100) // 21 to 99
{
$w .= $nwords[10 * floor($x/10)];
$r = fmod($x, 10);
if($r > 0)
{
$w .= ' '. $nwords[$r];
}
}
elseif($x < 1000) // 100 to 999
{
$w .= $nwords[floor($x/100)] .' hundred';
$r = fmod($x, 100);
if($r > 0)
{
$w .= ' and '. self::numberToString($r);
}
}
elseif($x < 1000000) // 1000 to 999999
{
$w .= self::numberToString(floor($x/1000)) .' thousand';
$r = fmod($x, 1000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
else // millions
{
$w .= self::numberToString(floor($x/1000000)) .' million';
$r = fmod($x, 1000000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
}
return $w;
} }
/** /**
* Random Key * Random Key
* *
* @returns a string * @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
*/ */
public static function randomkey($size) public static function randomkey($size)
{ {
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ"; return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
$key = array();
$bagsize = strlen($bag) - 1;
for ($i = 0; $i < $size; $i++)
{
$get = rand(0, $bagsize);
$key[] = $bag[$get];
}
return implode($key);
}###GET_CRYPT_KEY### }###GET_CRYPT_KEY###
} }

View File

@ -47,7 +47,7 @@ abstract class ###Component###Helper
if (!isset(self::$composer[$target])) if (!isset(self::$composer[$target]))
{ {
// get the function name // get the function name
$functionName = self::safeString('compose' . $target); $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target);
// check if method exist // check if method exist
if (method_exists(__CLASS__, $functionName)) if (method_exists(__CLASS__, $functionName))
{ {
@ -59,54 +59,22 @@ abstract class ###Component###Helper
} }
/** /**
* Convert it into a string * Convert a json object to a string
*
* @input string $value The json string to convert
*
* @returns a string
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...);
*/ */
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{ {
// do some table foot work return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
$external = false; $value,
if (strpos($table, '#__') !== false) $sperator,
{ $table,
$external = true; $id,
$table = str_replace('#__', '', $table); $name
} );
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (self::checkArray($result))
{
if (self::checkString($table))
{
$names = array();
foreach ($result as $val)
{
if ($external)
{
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $_name;
}
}
else
{
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $_name;
}
}
}
if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
}
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
}
return $value;
} }
/** /**
@ -129,7 +97,7 @@ abstract class ###Component###Helper
public static function jVersion() public static function jVersion()
{ {
// check if set // check if set
if (!self::checkObject(self::$JVersion)) if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{ {
self::$JVersion = new JVersion(); self::$JVersion = new JVersion();
} }
@ -167,8 +135,8 @@ abstract class ###Component###Helper
$link_front = ''; $link_front = '';
$link_back = ''; $link_back = '';
} }
$contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
} }
} }
return $contributors; return $contributors;
@ -180,13 +148,13 @@ abstract class ###Component###Helper
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
{ {
// fix the name // fix the name
$name = self::safeString($name); $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models // full path to models
$fullPathModels = $path . '/models'; $fullPathModels = $path . '/models';
// load the model file // load the model file
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded // make sure the table path is loaded
if (!isset($config['table_path']) || !self::checkString($config['table_path'])) if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{ {
// This is the JCB default path to tables in Joomla 3.x // This is the JCB default path to tables in Joomla 3.x
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
@ -349,35 +317,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/ */
public static function xmlAppend(&$xml, $node) public static function xmlAppend(&$xml, $node)
{ {
if (!$node) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
} }
/** /**
@ -386,16 +331,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject * @param string $comment The comment to inject
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/ */
public static function xmlComment(&$xml, $comment) public static function xmlComment(&$xml, $comment)
{ {
$domXML = dom_import_simplexml($xml); Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
} }
/** /**
@ -405,14 +346,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element * @param array $attributes The attributes to apply to the XML element
* *
* @return null * @return null
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/ */
public static function xmlAddAttributes(&$xml, $attributes = array()) public static function xmlAddAttributes(&$xml, $attributes = array())
{ {
foreach ($attributes as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
{
$xml->addAttribute($key, $value);
}
} }
/** /**
@ -422,16 +360,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return void * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/ */
public static function xmlAddOptions(&$xml, $options = array()) public static function xmlAddOptions(&$xml, $options = array())
{ {
foreach ($options as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
} }
/** /**
@ -442,28 +375,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/ */
public static function getFieldObject(&$attributes, $default = '', $options = null) public static function getFieldObject(&$attributes, $default = '', $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
} }
/** /**
@ -473,27 +389,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/ */
public static function getFieldXML(&$attributes, $options = null) public static function getFieldXML(&$attributes, $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
} }
/** /**
@ -517,17 +417,17 @@ abstract class ###Component###Helper
// button attributes // button attributes
$buttonAttributes = array( $buttonAttributes = array(
'type' => 'radio', 'type' => 'radio',
'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button',
'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'class' => 'btn-group', 'class' => 'btn-group',
'filter' => 'INT', 'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0); 'default' => isset($args[2]) ? (int) $args[2] : 0);
// set the button options // set the button options
$buttonOptions = array( $buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO');
// return the input // return the input
return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
}###HELPER_UIKIT######HELPER_CREATEUSER### }###HELPER_UIKIT######HELPER_CREATEUSER###
/** /**
@ -541,46 +441,18 @@ abstract class ###Component###Helper
* @param string $main The component in which the table is found * @param string $main The component in which the table is found
* *
* @return mix string/int/float * @return mix string/int/float
* * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...);
*/ */
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{ {
if(!$where) return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
{ $table,
$where = JFactory::getUser()->id; $where,
} $whereString,
// Get a db connection. $what,
$db = JFactory::getDbo(); $operator,
// Create a new query object. $main
$query = $db->getQuery(true); );
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
}
elseif (is_string($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
} }
/** /**
@ -595,62 +467,19 @@ abstract class ###Component###Helper
* @param bool $unique The switch to return a unique array * @param bool $unique The switch to return a unique array
* *
* @return array * @return array
* * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...);
*/ */
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{ {
if(!$where) return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(
{ $table,
$where = JFactory::getUser()->id; $where,
} $whereString,
$what,
if (!self::checkArray($where) && $where > 0) $operator,
{ $main,
$where = array($where); $unique
} );
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
// add strings to array search
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
{
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
}
else
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if ($unique)
{
return array_unique($db->loadColumn());
}
return $db->loadColumn();
}
}
return false;
} }
public static function isPublished($id,$type) public static function isPublished($id,$type)
@ -708,7 +537,7 @@ abstract class ###Component###Helper
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
{ {
// load the user if not given // load the user if not given
if (!self::checkObject($user)) if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{ {
// get the user object // get the user object
$user = JFactory::getUser(); $user = JFactory::getUser();
@ -716,10 +545,10 @@ abstract class ###Component###Helper
// load the JObject // load the JObject
$result = new JObject; $result = new JObject;
// make view name safe (just incase) // make view name safe (just incase)
$view = self::safeString($view); $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (self::checkString($views)) if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{ {
$views = self::safeString($views); $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActionsFromFile( $actions = JAccess::getActionsFromFile(
@ -732,9 +561,9 @@ abstract class ###Component###Helper
return $result; return $result;
} }
// get created by if not found // get created by if not found
if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id))
{ {
$record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component);
} }
// set actions only set in component settings // set actions only set in component settings
$componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export');
@ -743,12 +572,12 @@ abstract class ###Component###Helper
if ($target) if ($target)
{ {
// convert to an array // convert to an array
if (self::checkString($target)) if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target))
{ {
$target = array($target); $target = array($target);
} }
// check if we are good to go // check if we are good to go
if (self::checkArray($target)) if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target))
{ {
$checkTarget = true; $checkTarget = true;
} }
@ -769,7 +598,7 @@ abstract class ###Component###Helper
// set area // set area
$area = 'comp'; $area = 'comp';
// check if the record has an ID and the action is item related (not a component action) // check if the record has an ID and the action is item related (not a component action)
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
(strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false))
{ {
// we are in item // we are in item
@ -802,7 +631,7 @@ abstract class ###Component###Helper
} }
} }
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0)
{ {
// we are in item // we are in item
$area = 'category'; $area = 'category';
@ -896,15 +725,11 @@ abstract class ###Component###Helper
* @input string The json string to check * @input string The json string to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
*/ */
public static function checkJson($string) public static function checkJson($string)
{ {
if (self::checkString($string)) return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
} }
/** /**
@ -913,14 +738,11 @@ abstract class ###Component###Helper
* @input object The object to check * @input object The object to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
*/ */
public static function checkObject($object) public static function checkObject($object)
{ {
if (isset($object) && is_object($object)) return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
{
return count((array)$object) > 0;
}
return false;
} }
/** /**
@ -929,26 +751,11 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
*/ */
public static function checkArray($array, $removeEmptyString = false) public static function checkArray($array, $removeEmptyString = false)
{ {
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0) return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
{
// also make sure the empty strings are removed
if ($removeEmptyString)
{
foreach ($array as $key => $string)
{
if (empty($string))
{
unset($array[$key]);
}
}
return self::checkArray($array, false);
}
return $nr;
}
return false;
} }
/** /**
@ -957,14 +764,11 @@ abstract class ###Component###Helper
* @input string The string to check * @input string The string to check
* *
* @returns bool true on success * @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
*/ */
public static function checkString($string) public static function checkString($string)
{ {
if (isset($string) && is_string($string) && strlen($string) > 0) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
{
return true;
}
return false;
} }
/** /**
@ -998,22 +802,11 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
*/ */
public static function mergeArrays($arrays) public static function mergeArrays($arrays)
{ {
if(self::checkArray($arrays)) return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
{
$arrayBuket = array();
foreach ($arrays as $array)
{
if (self::checkArray($array))
{
$arrayBuket = array_merge($arrayBuket, $array);
}
}
return $arrayBuket;
}
return false;
} }
// typo sorry! // typo sorry!
@ -1028,39 +821,11 @@ abstract class ###Component###Helper
* @input string The you would like to shorten * @input string The you would like to shorten
* *
* @returns string on success * @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
*/ */
public static function shorten($string, $length = 40, $addTip = true) public static function shorten($string, $length = 40, $addTip = true)
{ {
if (self::checkString($string)) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip);
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
for (; $last_word < $words_count; ++$last_word)
{
$word_length += strlen($words[$last_word]);
if ($word_length > $length)
{
break;
}
}
$newString = implode(array_slice($words, 0, $last_word));
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
{
return trim($newString).'...';
}
}
return $string;
} }
/** /**
@ -1069,157 +834,61 @@ abstract class ###Component###Helper
* @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
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
*/ */
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{ {
if ($replaceNumbers === true) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(
{ $string,
// remove all numbers and replace with english text version (works well only up to millions) $type,
$string = self::replaceNumbers($string); $spacer,
} $replaceNumbers,
// 0nly continue if we have a string $keepOnlyCharacters
if (self::checkString($string)) );
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
// Transliterate string
$string = self::transliterate($string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
} }
/**
* Convert none English strings to code usable string
*
* @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
*/
public static function transliterate($string) public static function transliterate($string)
{ {
// set tag only once return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
if (!self::checkString(self::$langTag))
{
// get global value
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
}
// Transliterate on the language requested
$lang = Language::getInstance(self::$langTag);
return $lang->transliterate($string);
} }
/**
* make sure a string is HTML save
*
* @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
*/
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{ {
if (self::checkString($var)) return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(
{ $var,
$filter = new JFilterInput(); $charset,
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML'); $shorten,
if ($shorten) $length
{ );
return self::shorten($string,$length);
}
return $string;
}
else
{
return '';
}
}###HELPER_SITE_LICENSE_LOCK### }###HELPER_SITE_LICENSE_LOCK###
/**
* Convert all int in a string to an English word string
*
* @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
*/
public static function replaceNumbers($string) public static function replaceNumbers($string)
{ {
// set numbers array return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
$numbers = array();
// first get all numbers
preg_match_all('!\d+!', $string, $numbers);
// check if we have any numbers
if (isset($numbers[0]) && self::checkArray($numbers[0]))
{
foreach ($numbers[0] as $number)
{
$searchReplace[$number] = self::numberToString((int)$number);
}
// now replace numbers in string
$string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
// check if we missed any, strange if we did.
return self::replaceNumbers($string);
}
// return the string with no numbers remaining.
return $string;
} }
/** /**
@ -1228,107 +897,21 @@ abstract class ###Component###Helper
* *
* @input an int * @input an int
* @returns a string * @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/ */
public static function numberToString($x) public static function numberToString($x)
{ {
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven", return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
"eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
"nineteen", "twenty", 30 => "thirty", 40 => "forty",
50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
90 => "ninety" );
if(!is_numeric($x))
{
$w = $x;
}
elseif(fmod($x, 1) != 0)
{
$w = $x;
}
else
{
if($x < 0)
{
$w = 'minus ';
$x = -$x;
}
else
{
$w = '';
// ... now $x is a non-negative integer.
}
if($x < 21) // 0 to 20
{
$w .= $nwords[$x];
}
elseif($x < 100) // 21 to 99
{
$w .= $nwords[10 * floor($x/10)];
$r = fmod($x, 10);
if($r > 0)
{
$w .= ' '. $nwords[$r];
}
}
elseif($x < 1000) // 100 to 999
{
$w .= $nwords[floor($x/100)] .' hundred';
$r = fmod($x, 100);
if($r > 0)
{
$w .= ' and '. self::numberToString($r);
}
}
elseif($x < 1000000) // 1000 to 999999
{
$w .= self::numberToString(floor($x/1000)) .' thousand';
$r = fmod($x, 1000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
else // millions
{
$w .= self::numberToString(floor($x/1000000)) .' million';
$r = fmod($x, 1000000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
}
return $w;
} }
/** /**
* Random Key * Random Key
* *
* @returns a string * @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
*/ */
public static function randomkey($size) public static function randomkey($size)
{ {
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ"; return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
$key = array();
$bagsize = strlen($bag) - 1;
for ($i = 0; $i < $size; $i++)
{
$get = rand(0, $bagsize);
$key[] = $bag[$get];
}
return implode($key);
}###GET_CRYPT_KEY### }###GET_CRYPT_KEY###
} }

View File

@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView
protected function setDocument() protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file // add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
} }
/** /**

View File

@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView
protected function setDocument() protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file // add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sviews###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
} }
/** /**

View File

@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView
protected function _prepareDocument() protected function _prepareDocument()
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file // add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
} }
/** /**

View File

@ -41,7 +41,7 @@ class ###Component###View###SView### extends HtmlView
protected function _prepareDocument() protected function _prepareDocument()
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file // add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
} }
/** /**

View File

@ -551,35 +551,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/ */
public static function xmlAppend(&$xml, $node) public static function xmlAppend(&$xml, $node)
{ {
if (!$node) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
} }
/** /**
@ -588,16 +565,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject * @param string $comment The comment to inject
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/ */
public static function xmlComment(&$xml, $comment) public static function xmlComment(&$xml, $comment)
{ {
$domXML = dom_import_simplexml($xml); Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
} }
/** /**
@ -607,14 +580,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element * @param array $attributes The attributes to apply to the XML element
* *
* @return null * @return null
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/ */
public static function xmlAddAttributes(&$xml, $attributes = array()) public static function xmlAddAttributes(&$xml, $attributes = array())
{ {
foreach ($attributes as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
{
$xml->addAttribute($key, $value);
}
} }
/** /**
@ -624,16 +594,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return void * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/ */
public static function xmlAddOptions(&$xml, $options = array()) public static function xmlAddOptions(&$xml, $options = array())
{ {
foreach ($options as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
} }
/** /**
@ -644,28 +609,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/ */
public static function getFieldObject(&$attributes, $default = '', $options = null) public static function getFieldObject(&$attributes, $default = '', $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
} }
/** /**
@ -675,27 +623,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/ */
public static function getFieldXML(&$attributes, $options = null) public static function getFieldXML(&$attributes, $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
} }
/** /**

View File

@ -303,35 +303,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/ */
public static function xmlAppend(&$xml, $node) public static function xmlAppend(&$xml, $node)
{ {
if (!$node) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
} }
/** /**
@ -340,16 +317,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject * @param string $comment The comment to inject
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/ */
public static function xmlComment(&$xml, $comment) public static function xmlComment(&$xml, $comment)
{ {
$domXML = dom_import_simplexml($xml); Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
} }
/** /**
@ -358,15 +331,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $attributes The attributes to apply to the XML element * @param array $attributes The attributes to apply to the XML element
* *
* @return null * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/ */
public static function xmlAddAttributes(&$xml, $attributes = array()) public static function xmlAddAttributes(&$xml, $attributes = array())
{ {
foreach ($attributes as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
{
$xml->addAttribute($key, $value);
}
} }
/** /**
@ -376,16 +346,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return void * @return void
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/ */
public static function xmlAddOptions(&$xml, $options = array()) public static function xmlAddOptions(&$xml, $options = array())
{ {
foreach ($options as $key => $value) Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
} }
/** /**
@ -396,28 +361,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/ */
public static function getFieldObject(&$attributes, $default = '', $options = null) public static function getFieldObject(&$attributes, $default = '', $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
} }
/** /**
@ -427,27 +375,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element * @param array $options The options to apply to the XML element
* *
* @return object * @return object
* * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/ */
public static function getFieldXML(&$attributes, $options = null) public static function getFieldXML(&$attributes, $options = null)
{ {
// make sure we have attributes and a type value return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
} }
/** /**

View File

@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM### ###BOM###
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
###ADMIN_COMPONENT_HEADER### ###ADMIN_COMPONENT_HEADER###

View File

@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM### ###BOM###
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
###SITE_COMPONENT_HEADER### ###SITE_COMPONENT_HEADER###

View File

@ -0,0 +1,10 @@
/**
* @package getBible.net
*
* @created ###CREATIONDATE###
* @author ###AUTHOR### <###AUTHORWEBSITE###>
* @git Get Bible <https://git.vdm.dev/getBible>
* @github Get Bible <https://github.com/getBible>
* @copyright ###COPYRIGHT###
* @license ###LICENSE###
*/

View File

@ -207,6 +207,12 @@
"rename": false, "rename": false,
"type": "file" "type": "file"
}, },
"CHANGELOG.md": {
"naam": "CHANGELOG.md",
"path": "c0mp0n3nt/",
"rename": false,
"type": "file"
},
"headercheck.php": { "headercheck.php": {
"naam": "headercheck.php", "naam": "headercheck.php",
"path": "c0mp0n3nt/site/helpers", "path": "c0mp0n3nt/site/helpers",

View File

@ -207,6 +207,12 @@
"rename": false, "rename": false,
"type": "file" "type": "file"
}, },
"CHANGELOG.md": {
"naam": "CHANGELOG.md",
"path": "c0mp0n3nt/",
"rename": false,
"type": "file"
},
"headercheck.php": { "headercheck.php": {
"naam": "headercheck.php", "naam": "headercheck.php",
"path": "c0mp0n3nt/site/helpers", "path": "c0mp0n3nt/site/helpers",

View File

@ -12,6 +12,61 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); 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 = [
'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai',
'libraries/jcb_powers/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea',
'libraries/jcb_powers/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF',
'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla',
'libraries/jcb_powers/VDM.Minify' => 'VDM\\Minify',
'libraries/jcb_powers/VDM.Psr' => 'VDM\\Psr'
];
// Start the search and load if found
$found = false;
$found_base_dir = "";
$found_len = 0;
foreach ($search as $base_dir => $prefix)
{
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) === 0)
{
// we have a match so load the values
$found = true;
$found_base_dir = $base_dir;
$found_len = $len;
// done here
break;
}
}
// check if we found a match
if (!$found)
{
// not found so move to the next registered autoloader
return;
}
// get the relative class name
$relative_class = substr($class, $found_len);
// replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php';
// if the file exists, require it
if (file_exists($file))
{
require $file;
}
});
// Access check. // Access check.

View File

@ -289,6 +289,18 @@
name="uikit_config" name="uikit_config"
label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LABEL" label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_UIKIT_DESC"> description="COM_COMPONENTBUILDER_CONFIG_UIKIT_DESC">
<field name="add_jquery_framework"
type="radio"
label="COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD_DESC"
class="btn-group btn-group-yesno"
default="">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_CONFIG_JQUERY_REMOVE</option>"
<option value="1">
COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD</option>"
</field>
<field name="uikit_load" <field name="uikit_load"
type="radio" type="radio"
label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LOAD_LABEL" label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LOAD_LABEL"
@ -678,15 +690,218 @@
size="60" size="60"
default="" default=""
/> />
<field type="note" name="medium_key_note" class="alert alert-info" label="COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_DESC" /> </fieldset>
<field name="medium_key_path" <fieldset
name="super_power_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWER">
<!-- Note_not_ready_super_powers Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_not_ready_super_powers" label="COM_COMPONENTBUILDER_CONFIG_NOTE_NOT_READY_SUPER_POWERS_LABEL" heading="h2" class="alert alert-error note_not_ready_super_powers" />
<!-- Super_powers_documentation Field. Type: Radio. (joomla) -->
<field
type="radio"
name="super_powers_documentation"
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_DOCUMENTATION_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_DOCUMENTATION_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_SHOW</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_HIDE</option>
</field>
<!-- Note_super_powers Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_super_powers" label="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_DESCRIPTION" heading="h4" class="alert alert-info note_super_powers" showon="super_powers_documentation:1" />
<!-- Powers_repository Field. Type: Radio. (joomla) -->
<field
type="radio"
name="powers_repository"
label="COM_COMPONENTBUILDER_CONFIG_POWERS_REPOSITORY_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_POWERS_REPOSITORY_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Super_powers_repositories Field. Type: Radio. (joomla) -->
<field
type="radio"
name="super_powers_repositories"
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_REPOSITORIES_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_REPOSITORIES_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0"
required="true"
showon="powers_repository:1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Note_super_powers_repositories Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_super_powers_repositories" label="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_DESCRIPTION" heading="h4" class="alert alert-info note_super_powers_repositories" showon="powers_repository:1[AND]super_powers_repositories:1" />
<!-- Approved_paths Field. Type: Subform. (joomla) -->
<field
type="subform"
name="approved_paths"
label="COM_COMPONENTBUILDER_CONFIG_APPROVED_PATHS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="30"
min="1"
showon="powers_repository:1[AND]super_powers_repositories:1">
<form hidden="true" name="list_approved_paths_modal" repeat="true">
<!-- Owner Field. Type: Text. (joomla) -->
<field
type="text" type="text"
label="COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_LABEL" name="owner"
description="COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_DESC" label="COM_COMPONENTBUILDER_CONFIG_OWNER_LABEL"
size="160" size="70"
maxlength="150"
class="text_area span12"
readonly="false"
filter="CMD"
hint="COM_COMPONENTBUILDER_CONFIG_OWNER_HINT"
autocomplete="on"
/>
<!-- Repo Field. Type: Text. (joomla) -->
<field
type="text"
name="repo"
label="COM_COMPONENTBUILDER_CONFIG_REPO_LABEL"
size="70"
maxlength="150"
class="text_area span12"
readonly="false"
filter="CMD"
hint="COM_COMPONENTBUILDER_CONFIG_REPO_HINT"
autocomplete="on"
/>
<!-- Branch Field. Type: Text. (joomla) -->
<field
type="text"
name="branch"
label="COM_COMPONENTBUILDER_CONFIG_BRANCH_LABEL"
size="70"
maxlength="150"
default="default"
class="text_area span12"
readonly="false"
filter="CMD"
hint="COM_COMPONENTBUILDER_CONFIG_BRANCH_HINT"
autocomplete="on"
/>
</form>
</field>
<!-- Note_powers_repository_path Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_powers_repository_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_POWERS_REPOSITORY_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_POWERS_REPOSITORY_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_powers_repository_path" showon="powers_repository:1" />
<!-- Local_powers_repository_path Field. Type: Text. (joomla) -->
<field
type="text"
name="local_powers_repository_path"
label="COM_COMPONENTBUILDER_CONFIG_LOCAL_POWERS_REPOSITORY_PATH_LABEL"
size="70"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_LOCAL_POWERS_REPOSITORY_PATH_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="false"
filter="PATH" filter="PATH"
hint="/home/user/hiddenfolder123/" message="COM_COMPONENTBUILDER_CONFIG_LOCAL_POWERS_REPOSITORY_PATH_MESSAGE"
default="" hint="COM_COMPONENTBUILDER_CONFIG_LOCAL_POWERS_REPOSITORY_PATH_HINT"
autocomplete="on"
showon="powers_repository:1"
/>
<!-- Add_custom_gitea_url Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_custom_gitea_url"
label="COM_COMPONENTBUILDER_CONFIG_ADD_CUSTOM_GITEA_URL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_ADD_CUSTOM_GITEA_URL_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_GITVDMDEV</option>
<option value="2">
COM_COMPONENTBUILDER_CONFIG_CUSTOMGITEA</option>
</field>
<!-- Note_custom_gitea_url Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_custom_gitea_url" label="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_GITEA_URL_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_GITEA_URL_DESCRIPTION" heading="h3" class="alert alert-success note_custom_gitea_url" showon="add_custom_gitea_url:2" />
<!-- Custom_gitea_url Field. Type: Url. (joomla) -->
<field
type="url"
name="custom_gitea_url"
label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_LABEL"
size="70"
maxlength="150"
default="https://git.vdm.dev"
description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_DESCRIPTION"
class="text_area"
filter="url"
validated="url"
scheme="http,https"
message="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_MESSAGE"
hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_HINT"
autocomplete="on"
showon="add_custom_gitea_url:2"
/>
<!-- Custom_gitea_token Field. Type: Password. (joomla) -->
<field
type="password"
name="custom_gitea_token"
label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_LABEL"
size="128"
description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_DESCRIPTION"
message="Error! Please add token here."
class="text_area"
readonly="false"
disabled="false"
required="false"
filter="STRING"
hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_HINT"
autocomplete="off"
showon="add_custom_gitea_url:2"
/>
<!-- Super_powers_core_organisation_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="super_powers_core_organisation_note" label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_NOTE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_NOTE_DESCRIPTION" heading="h4" class="alert alert-success super_powers_core_organisation_note" showon="add_custom_gitea_url:2" />
<!-- Super_powers_core_organisation Field. Type: Text. (joomla) -->
<field
type="text"
name="super_powers_core_organisation"
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_LABEL"
size="70"
maxlength="150"
default="joomla"
description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_DESCRIPTION"
class="text_area"
filter="WORD"
hint="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_HINT"
autocomplete="on"
showon="add_custom_gitea_url:2"
/>
<!-- Super_powers_core Field. Type: Text. (joomla) -->
<field
type="text"
name="super_powers_core"
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_LABEL"
size="70"
maxlength="150"
default="joomla/super-powers"
class="text_area"
filter="PATH"
hint="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_HINT"
autocomplete="on"
showon="add_custom_gitea_url:2"
/> />
</fieldset> </fieldset>
<fieldset <fieldset
@ -930,11 +1145,11 @@
min="1" min="1"
showon="development_method:2"> showon="development_method:2">
<form hidden="true" name="list_expansion_modal" repeat="true"> <form hidden="true" name="list_expansion_modal" repeat="true">
<!-- Component Field. Type: Joomlacomponent. (custom) --> <!-- Component_id Field. Type: Joomlacomponent. (custom) -->
<field <field
type="joomlacomponent" type="joomlacomponent"
name="component" name="component_id"
label="COM_COMPONENTBUILDER_CONFIG_COMPONENT_LABEL" label="COM_COMPONENTBUILDER_CONFIG_COMPONENT_ID_LABEL"
class="list_class" class="list_class"
multiple="false" multiple="false"
default="0" default="0"
@ -973,14 +1188,14 @@
description="COM_COMPONENTBUILDER_CONFIG_REPOSITORY_DESCRIPTION" description="COM_COMPONENTBUILDER_CONFIG_REPOSITORY_DESCRIPTION"
class="inputbox" class="inputbox"
/> />
<!-- Placeholders Field. Type: Checkbox. (joomla) --> <!-- Add_placeholders Field. Type: Checkbox. (joomla) -->
<field <field
type="checkbox" type="checkbox"
name="placeholders" name="add_placeholders"
label="COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_LABEL" label="COM_COMPONENTBUILDER_CONFIG_ADD_PLACEHOLDERS_LABEL"
value="1" value="1"
default="" default=""
description="COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_DESCRIPTION" description="COM_COMPONENTBUILDER_CONFIG_ADD_PLACEHOLDERS_DESCRIPTION"
class="inputbox" class="inputbox"
/> />
</form> </form>

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('admin_custom_tabs.create', $this->option); return $user->authorise('admin_custom_tabs.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields.create', $this->option); return $user->authorise('admin_fields.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields_conditions.create', $this->option); return $user->authorise('admin_fields_conditions.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields_relations.create', $this->option); return $user->authorise('admin_fields_relations.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_view extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('admin_view.create', $this->option); return $user->authorise('admin_view.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Admin_views Admin Controller * Admin_views Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerAdmin_views extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -67,6 +67,11 @@ class ComponentbuilderControllerAjax extends BaseController
$this->registerTask('fieldTypeProperties', 'ajax'); $this->registerTask('fieldTypeProperties', 'ajax');
$this->registerTask('getFieldPropertyDesc', 'ajax'); $this->registerTask('getFieldPropertyDesc', 'ajax');
$this->registerTask('getCodeGlueOptions', 'ajax'); $this->registerTask('getCodeGlueOptions', '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('snippetDetails', 'ajax');
$this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax');
$this->registerTask('getSnippets', 'ajax'); $this->registerTask('getSnippets', 'ajax');
@ -1631,6 +1636,241 @@ class ComponentbuilderControllerAjax extends BaseController
} }
} }
break; break;
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 && $type_searchValue && $search_valueValue)
{
$result = $this->getModel('ajax')->doSearch($table_nameValue, $type_searchValue, $search_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 'replaceAll':
try
{
$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');
$component_idValue = $jinput->get('component_id', 0, 'INT');
if($table_nameValue && $user->id != 0 && $search_valueValue)
{
$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
{
$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 'snippetDetails': case 'snippetDetails':
try try
{ {

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_extends extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('class_extends.create', $this->option); return $user->authorise('class_extends.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_method extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('class_method.create', $this->option); return $user->authorise('class_method.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_property extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('class_property.create', $this->option); return $user->authorise('class_property.create', $this->option);
} }

View File

@ -14,6 +14,9 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Compiler Admin Controller * Compiler Admin Controller
@ -50,7 +53,7 @@ class ComponentbuilderControllerCompiler extends AdminController
* *
* @return true on success * @return true on success
*/ */
public function getCompilerAnimations() public function getDynamicContent()
{ {
// Check for request forgeries // Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
@ -64,7 +67,7 @@ class ComponentbuilderControllerCompiler extends AdminController
{ {
// get the model // get the model
$model = $this->getModel('compiler'); $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'); $message = JText::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB');
$this->setRedirect($redirect_url, $message, 'message'); $this->setRedirect($redirect_url, $message, 'message');
@ -89,20 +92,10 @@ class ComponentbuilderControllerCompiler extends AdminController
// currently only those with admin access can compile a component // currently only those with admin access can compile a component
if($user->authorise('core.manage', 'com_componentbuilder')) if($user->authorise('core.manage', 'com_componentbuilder'))
{ {
// get the post values
$jinput = JFactory::getApplication()->input;
$componentId = $jinput->post->get('component', 0, 'INT');
$version = $jinput->post->get('version', 0, 'INT');
$addBackup = $jinput->post->get('backup', 0, 'INT');
$addRepo = $jinput->post->get('repository', 0, 'INT');
$addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
$addPowers = $jinput->post->get('powers', 2, 'INT');
$debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT');
$minify = $jinput->post->get('minify', 2, 'INT');
// include component compiler // include component compiler
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php'; require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php';
$model = $this->getModel('compiler'); $model = $this->getModel('compiler');
if ($model->builder($version, $componentId, $addBackup, $addRepo, $addPlaceholders, $addPowers, $debugLinenr, $minify)) if ($model->builder())
{ {
$cache = JFactory::getCache('mod_menu'); $cache = JFactory::getCache('mod_menu');
$cache->clean(); $cache->clean();
@ -123,7 +116,7 @@ class ComponentbuilderControllerCompiler extends AdminController
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); $redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
// get system messages // get system messages
$message = $app->getUserState('com_componentbuilder.message'); $message = $app->getUserState('com_componentbuilder.message');
if (empty($redirect_url) && $componentId > 0) if (empty($redirect_url) && CFactory::_('Config')->component_id > 0)
{ {
// start new message // start new message
$message = array(); $message = array();
@ -134,9 +127,9 @@ class ComponentbuilderControllerCompiler extends AdminController
$url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1); $url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1);
} }
// check if we have plugins // check if we have plugins
$add_plugin_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins'], true); $add_plugin_install = UtilitiesArrayHelper::check($model->compiler->filepath['plugins'], true);
// check if we have modules // check if we have modules
$add_module_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['modules'], true); $add_module_install = UtilitiesArrayHelper::check($model->compiler->filepath['modules'], true);
// if a multi install we set another kind of header // if a multi install we set another kind of header
if ($add_plugin_install || $add_module_install) if ($add_plugin_install || $add_module_install)
{ {
@ -180,19 +173,19 @@ class ComponentbuilderControllerCompiler extends AdminController
} }
$message[] = '<h2>Total time saved</h2>'; $message[] = '<h2>Total time saved</h2>';
$message[] = '<ul>'; $message[] = '<ul>';
$message[] = '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>'; $message[] = '<li>Total folders created: <b>#'.'##FOLDER_COUNT##'.'#</b></li>';
$message[] = '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>'; $message[] = '<li>Total files created: <b>#'.'##FILE_COUNT##'.'#</b></li>';
$message[] = '<li>Total fields created: <b>'.$model->compiler->fieldCount.'</b></li>'; $message[] = '<li>Total fields created: <b>#'.'##FIELD_COUNT##'.'#</b></li>';
$message[] = '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>'; $message[] = '<li>Total lines written: <b>#'.'##LINE_COUNT##'.'#</b></li>';
$message[] = '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>'; $message[] = '<li>A4 Book of: <b>#'.'##PAGE_COUNT##'.'# pages</b></li>';
$message[] = '</ul>'; $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[] = '<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[] = '<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 @'.$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[] = '<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>'.$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[] = '<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[] = '<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 // check if we have modules or plugins
if ($add_multi_install) if ($add_multi_install)
{ {
@ -234,7 +227,7 @@ class ComponentbuilderControllerCompiler extends AdminController
$message[] = '<br /><small>Hey! you can also download these zip files right now!</small><br />'; $message[] = '<br /><small>Hey! you can also download these zip files right now!</small><br />';
$message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download Component</a>&nbsp;&nbsp;'; $message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download Component</a>&nbsp;&nbsp;';
// load the module download URL's // load the module download URL's
if (isset($module_urls) && ComponentbuilderHelper::checkArray($module_urls)) if (isset($module_urls) && UtilitiesArrayHelper::check($module_urls))
{ {
foreach ($module_urls as $module_id => $module_url) foreach ($module_urls as $module_id => $module_url)
{ {
@ -243,7 +236,7 @@ class ComponentbuilderControllerCompiler extends AdminController
} }
} }
// load the plugin download URL's // load the plugin download URL's
if (isset($plugin_urls) && ComponentbuilderHelper::checkArray($plugin_urls)) if (isset($plugin_urls) && UtilitiesArrayHelper::check($plugin_urls))
{ {
foreach ($plugin_urls as $plugin_id => $plugin_url) foreach ($plugin_urls as $plugin_id => $plugin_url)
{ {
@ -263,9 +256,14 @@ class ComponentbuilderControllerCompiler extends AdminController
$message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download</a></p>'; $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><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 // 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::_('Compiler.Builder.Content.One')->allActive()
)
);
// set redirect // set redirect
$this->setRedirect($redirect_url, '<h2>Successful Build!</h2>', 'message'); $this->setRedirect($redirect_url, '<h2>Successful Build!</h2>', 'message');
$app->setUserState('com_componentbuilder.component_folder_name', $model->compiler->filepath['component-folder']); $app->setUserState('com_componentbuilder.component_folder_name', $model->compiler->filepath['component-folder']);
@ -322,9 +320,9 @@ class ComponentbuilderControllerCompiler extends AdminController
$fileNames = array(); $fileNames = array();
$fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null); $fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null);
// check if we have modules // check if we have modules
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) )); $fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
// check if we have plugins // check if we have plugins
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) )); $fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
// wipe out the user c-m-p since we are done with them all // wipe out the user c-m-p since we are done with them all
$app->setUserState('com_componentbuilder.component_folder_name', ''); $app->setUserState('com_componentbuilder.component_folder_name', '');
@ -345,12 +343,12 @@ class ComponentbuilderControllerCompiler extends AdminController
} }
} }
// catch errors // catch errors
if (ComponentbuilderHelper::checkArray($_message['error'])) if (UtilitiesArrayHelper::check($_message['error']))
{ {
$app->enqueueMessage(implode('<br />', $_message['error']), 'Error'); $app->enqueueMessage(implode('<br />', $_message['error']), 'Error');
} }
// build success message // build success message
if (ComponentbuilderHelper::checkArray($_message['success'])) if (UtilitiesArrayHelper::check($_message['success']))
{ {
$this->setRedirect($redirect_url, implode('<br />', $_message['success']), 'message'); $this->setRedirect($redirect_url, implode('<br />', $_message['success']), 'message');
return true; return true;
@ -538,7 +536,7 @@ class ComponentbuilderControllerCompiler extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;
@ -619,7 +617,7 @@ class ComponentbuilderControllerCompiler extends AdminController
// run translator via API // run translator via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.translator'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.translator');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_admin_views.create', $this->option); return $user->authorise('component_admin_views.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_config extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_config.create', $this->option); return $user->authorise('component_config.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_custom_admin_menus.create', $this->option); return $user->authorise('component_custom_admin_menus.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_custom_admin_views.create', $this->option); return $user->authorise('component_custom_admin_views.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_dashboard.create', $this->option); return $user->authorise('component_dashboard.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_files_folders.create', $this->option); return $user->authorise('component_files_folders.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_modules extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_modules.create', $this->option); return $user->authorise('component_modules.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_mysql_tweaks.create', $this->option); return $user->authorise('component_mysql_tweaks.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_placeholders.create', $this->option); return $user->authorise('component_placeholders.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_plugins.create', $this->option); return $user->authorise('component_plugins.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_site_views.create', $this->option); return $user->authorise('component_site_views.create', $this->option);
} }

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Component_updates Form Controller * Component_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerComponent_updates extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('component_updates.create', $this->option); return $user->authorise('component_updates.create', $this->option);
} }
@ -332,9 +334,9 @@ class ComponentbuilderControllerComponent_updates extends FormController
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_component']; $objectUpdate->id = (int) $validData['joomla_component'];
if (ComponentbuilderHelper::checkArray($version_update) if (UtilitiesArrayHelper::check($version_update)
&& ($component_version = end($version_update)['version']) && ($component_version = end($version_update)['version'])
&& ComponentbuilderHelper::checkString($component_version)) && StringHelper::check($component_version))
{ {
$objectUpdate->component_version = $component_version; $objectUpdate->component_version = $component_version;
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_code extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('custom_code.create', $this->option); return $user->authorise('custom_code.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Custom_codes Admin Controller * Custom_codes Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerCustom_codes extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerDynamic_get extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('dynamic_get.create', $this->option); return $user->authorise('dynamic_get.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Dynamic_gets Admin Controller * Dynamic_gets Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerDynamic_gets extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerField extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('field.create', $this->option); return $user->authorise('field.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Fields Admin Controller * Fields Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerFields extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerFieldtype extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('fieldtype.create', $this->option); return $user->authorise('fieldtype.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerHelp_document extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('help_document.create', $this->option); return $user->authorise('help_document.create', $this->option);
} }

View File

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

View File

@ -87,7 +87,7 @@ class ComponentbuilderControllerJoomla_component extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_component.create', $this->option); return $user->authorise('joomla_component.create', $this->option);
} }

View File

@ -14,6 +14,11 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Utilities\ObjectHelper;
/** /**
* Joomla_components Admin Controller * Joomla_components Admin Controller
@ -131,7 +136,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;
@ -198,12 +203,12 @@ class ComponentbuilderControllerJoomla_components extends AdminController
$session->set('backto_VDM_IMPORT', 'joomla_components'); $session->set('backto_VDM_IMPORT', 'joomla_components');
$session->set('dataType_VDM_IMPORTINTO', 'smart_package'); $session->set('dataType_VDM_IMPORTINTO', 'smart_package');
// Redirect to import view. // Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL'); $message = Text::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message);
return; return;
} }
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -211,7 +216,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function smartExport() public function smartExport()
{ {
// Check for request forgeries // Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(Text::_('JINVALID_TOKEN'));
// Get the model // Get the model
$model = $this->getModel('Joomla_components'); $model = $this->getModel('Joomla_components');
// check if export is allowed for this user. // check if export is allowed for this user.
@ -224,10 +229,10 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// Sanitize the input // Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// check if there is any selections // check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks)) if (!JCBArrayHelper::check($pks))
{ {
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); $message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -237,43 +242,44 @@ class ComponentbuilderControllerJoomla_components extends AdminController
if ($model->getSmartExport($pks)) if ($model->getSmartExport($pks))
{ {
// set the key string // set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32) if (StringHelper::check($model->key) && strlen($model->key) == 32)
{ {
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>'; $keyNotice = '<h1>' . Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</h1>'; $keyNotice .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
// set the package owner info // set the package owner info
if (componentbuilderHelper::getPackageOwnerValue('owner', $model->info) || componentbuilderHelper::getPackageOwnerValue('company', $model->info)) if (PackageFactory::_('Display.Details')->hasOwner($model->info))
{ {
$ownerDetails = componentbuilderHelper::getPackageOwnerDetailsDisplay($model->info, true); $ownerDetails = PackageFactory::_('Display.Details')->owner($model->info, true);
} }
else else
{ {
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>'; $ownerDetails = '<h2>' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '</p>'; $ownerDetails .= '<p>' . Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '</p>';
$ownerDetails .= '<h3>' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>'; $ownerDetails .= '<h3>' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '</p>'; $ownerDetails .= '<p>' . Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '</p>';
} }
} }
else else
{ {
$keyNotice = '<h1>' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>'; $keyNotice = '<h1>' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
$ownerDetails = '<p>' . JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '</p>'; $ownerDetails = '<p>' . Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '</p>';
} }
// Redirect to the list screen with success. // Redirect to the list screen with success.
$message = array(); $message = array();
$message[] = '<h1>' . JText::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '</h1>'; $message[] = '<h1>' . Text::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '</h1>';
$message[] = '<p>' . JText::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '</p>'; $message[] = '<p>' . JText::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '</p>';
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success');
return; return;
} }
else else
{ {
if (componentbuilderHelper::checkString($model->packagePath)) if (StringHelper::check($model->packagePath))
{ {
// clear all if not successful // clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath); ComponentbuilderHelper::removeFolder($model->packagePath);
} }
if (componentbuilderHelper::checkString($model->zipPath)) if (StringHelper::check($model->zipPath))
{ {
// clear all if not successful // clear all if not successful
JFile::delete($model->zipPath); JFile::delete($model->zipPath);
@ -281,7 +287,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
} }
} }
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER'); $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -289,7 +295,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function backup() public function backup()
{ {
// get params first // get params first
if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params)) if (!isset($this->params) || !ObjectHelper::check($this->params))
{ {
$this->params = JComponentHelper::getParams('com_componentbuilder'); $this->params = JComponentHelper::getParams('com_componentbuilder');
} }
@ -309,54 +315,54 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// manual backup message // manual backup message
$backupNotice = array(); $backupNotice = array();
// get the data to export // get the data to export
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks)) if (JCBArrayHelper::check($pks) && $model->getSmartExport($pks))
{ {
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY');
$backupNoticeStatus = 'Success'; $backupNoticeStatus = 'Success';
// set the key string // set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32) if (StringHelper::check($model->key) && strlen($model->key) == 32)
{ {
$textNotice = array(); $textNotice = array();
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>'; $keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); $textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key);
$keyNotice .= JText::_('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') . '<br />';
// set the package owner info // set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))) if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])))
{ {
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>'; $ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
$ownerDetails .= '<ul>'; $ownerDetails .= '<ul>';
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']);
} }
// add value only if set // add value only if set
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])) if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']);
} }
// add value only if set // add value only if set
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website'])) if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']);
} }
// add value only if set // add value only if set
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email'])) if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']);
} }
// add value only if set // add value only if set
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license'])) if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']);
} }
// add value only if set // add value only if set
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright'])) if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright']))
{ {
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>'; $ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']);
@ -412,12 +418,12 @@ class ComponentbuilderControllerJoomla_components extends AdminController
{ {
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR');
$backupNoticeStatus = 'Error'; $backupNoticeStatus = 'Error';
if (componentbuilderHelper::checkString($model->packagePath)) if (StringHelper::check($model->packagePath))
{ {
// clear all if not successful // clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath); ComponentbuilderHelper::removeFolder($model->packagePath);
} }
if (componentbuilderHelper::checkString($model->zipPath)) if (StringHelper::check($model->zipPath))
{ {
// clear all if not successful // clear all if not successful
JFile::delete($model->zipPath); JFile::delete($model->zipPath);
@ -449,7 +455,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function cloner() public function cloner()
{ {
// Check for request forgeries // Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(Text::_('JINVALID_TOKEN'));
// Get the model // Get the model
$model = $this->getModel('Joomla_components'); $model = $this->getModel('Joomla_components');
// check if export is allowed for this user. // check if export is allowed for this user.
@ -462,10 +468,10 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// Sanitize the input // Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// check if there is any selections // check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks)) if (!JCBArrayHelper::check($pks))
{ {
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN'); $message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -473,7 +479,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
elseif (count( (array) $pks) !== 1) elseif (count( (array) $pks) !== 1)
{ {
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_ONLY_ONE_COMPONENT_CAN_BE_CLONED_AT_A_TIME_PLEASE_SELECT_ONE_AND_TRY_AGAIN'); $message = Text::_('COM_COMPONENTBUILDER_ONLY_ONE_COMPONENT_CAN_BE_CLONED_AT_A_TIME_PLEASE_SELECT_ONE_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -483,17 +489,17 @@ class ComponentbuilderControllerJoomla_components extends AdminController
if ($model->cloner($pks)) if ($model->cloner($pks))
{ {
// clone was successful // clone was successful
$message = JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL'); $message = Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message);
return; return;
} }
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_CLONE_FAILED'); $message = Text::_('COM_COMPONENTBUILDER_CLONE_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
@ -503,4 +509,5 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// admin area does not have API user, only front-end (so we fallback on login user) // admin area does not have API user, only front-end (so we fallback on login user)
return JFactory::getUser(); return JFactory::getUser();
} }
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module.create', $this->option); return $user->authorise('joomla_module.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module_files_folders_urls.create', $this->option); return $user->authorise('joomla_module_files_folders_urls.create', $this->option);
} }

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Joomla_module_updates Form Controller * Joomla_module_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module_updates.create', $this->option); return $user->authorise('joomla_module_updates.create', $this->option);
} }
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
{ {
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_plugin']; $objectUpdate->id = (int) $validData['joomla_plugin'];
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update']) if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
&& ($plugin_version = end($validData['version_update'])['version']) && ($plugin_version = end($validData['version_update'])['version'])
&& ComponentbuilderHelper::checkString($plugin_version)) && StringHelper::check($plugin_version))
{ {
$objectUpdate->plugin_version = $plugin_version; $objectUpdate->plugin_version = $plugin_version;
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin.create', $this->option); return $user->authorise('joomla_plugin.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin_files_folders_urls.create', $this->option); return $user->authorise('joomla_plugin_files_folders_urls.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Joomla_plugin_updates Form Controller * Joomla_plugin_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin_updates.create', $this->option); return $user->authorise('joomla_plugin_updates.create', $this->option);
} }
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
{ {
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_plugin']; $objectUpdate->id = (int) $validData['joomla_plugin'];
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update']) if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
&& ($plugin_version = end($validData['version_update'])['version']) && ($plugin_version = end($validData['version_update'])['version'])
&& ComponentbuilderHelper::checkString($plugin_version)) && StringHelper::check($plugin_version))
{ {
$objectUpdate->plugin_version = $plugin_version; $objectUpdate->plugin_version = $plugin_version;
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Joomla_plugins Admin Controller * Joomla_plugins Admin Controller
@ -68,7 +69,7 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('language.create', $this->option); return $user->authorise('language.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('language_translation.create', $this->option); return $user->authorise('language_translation.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLayout extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('library.create', $this->option); return $user->authorise('library.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_config extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('library_config.create', $this->option); return $user->authorise('library_config.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('library_files_folders_urls.create', $this->option); return $user->authorise('library_files_folders_urls.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerPlaceholder extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('placeholder.create', $this->option); return $user->authorise('placeholder.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Power\Factory;
/** /**
* Power Form Controller * Power Form Controller
@ -42,6 +43,62 @@ class ComponentbuilderControllerPower extends FormController
parent::__construct($config); parent::__construct($config);
} }
public function resetPowers()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// get Item posted
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
$user = JFactory::getUser();
// set default error message
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER') . '</p>';
$status = 'error';
$success = false;
// load the ID
$id = $item['id'] ?? null;
$guid = $item['guid'] ?? null;
// check if there is any selections
if ($id === null || $guid === null)
{
// set error message
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
}
elseif($user->authorise('power.reset', 'com_componentbuilder'))
{
if (Factory::_('Superpower')->reset([$guid]))
{
// set success message
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'</p>';
$status = 'success';
$success = true;
}
else
{
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '</p>';
}
}
// set redirect
$redirect_url = \JRoute::_(
'index.php?option=com_componentbuilder&view=power'
. $this->getRedirectToItemAppend($id), $success
);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
/** /**
* Method override to check if you can add a new record. * Method override to check if you can add a new record.
* *
@ -62,7 +119,7 @@ class ComponentbuilderControllerPower extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('power.create', $this->option); return $user->authorise('power.create', $this->option);
} }

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Power\Factory;
/** /**
* Powers Admin Controller * Powers Admin Controller
@ -68,7 +70,7 @@ class ComponentbuilderControllerPowers extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;
@ -84,4 +86,83 @@ class ComponentbuilderControllerPowers extends AdminController
return false; return false;
} }
public function initPowers()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if user has the right
$user = JFactory::getUser();
// set default error message
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS') . '</p>';
$status = 'error';
$success = false;
if($user->authorise('power.init', 'com_componentbuilder'))
{
if (Factory::_('Superpower')->init())
{
// set success message
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '</p>';
$status = 'success';
$success = true;
}
else
{
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '</p>';
}
}
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', $success);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
public function resetPowers()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// get IDS of the selected powers
$pks = $this->input->post->get('cid', [], 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
// check if there is any selections
if ($pks == [])
{
// set error message
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'</h1>';
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'</p>';
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message, 'error');
return false;
}
// check if user has the right
$user = JFactory::getUser();
if($user->authorise('power.reset', 'com_componentbuilder'))
{
// set success message
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_THIS_RESET_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'</h1>';
$message .= '<p>'.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '<a href="https://git.vdm.dev/joomla/Component-Builder/issues/984" target="_blank">').'</p>';
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message);
return true;
}
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url);
return false;
}
} }

View File

@ -0,0 +1,42 @@
<?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');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
/**
* Componentbuilder Search Base Controller
*/
class ComponentbuilderControllerSearch extends BaseController
{
public function __construct($config)
{
parent::__construct($config);
}
public function dashboard()
{
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false));
return;
}
public function openCompiler()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the libraries
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=compiler', false));
return;
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerServer extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('server.create', $this->option); return $user->authorise('server.create', $this->option);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerSite_view extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerSnippet extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerSnippet_type extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('snippet_type.create', $this->option); return $user->authorise('snippet_type.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/** /**
* Snippets Admin Controller * Snippets Admin Controller
@ -132,7 +133,7 @@ class ComponentbuilderControllerSnippets extends AdminController
// Sanitize the input // Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// check if there is any selections // check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks)) if (!UtilitiesArrayHelper::check($pks))
{ {
// Redirect to the list screen with error. // Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); $message = JText::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerTemplate extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return parent::allowAdd($data); return parent::allowAdd($data);
} }

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerValidation_rule extends FormController
return false; return false;
} }
// In the absense of better information, revert to the component permissions. // In the absence of better information, revert to the component permissions.
return $user->authorise('validation_rule.create', $this->option); return $user->authorise('validation_rule.create', $this->option);
} }

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/** /**
* Validation_rules Admin Controller * Validation_rules Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerValidation_rules extends AdminController
// run expansion via API // run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned // is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) if (!is_numeric($result) && StringHelper::check($result))
{ {
$this->setRedirect($redirect_url, $result); $this->setRedirect($redirect_url, $result);
return true; return true;

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

File diff suppressed because it is too large Load Diff

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