Compare commits

..

46 Commits

Author SHA1 Message Date
26050c771a Fixed the links of folders in libraries, added another note to libraries, started with linked to ajax functions. 2017-12-17 11:21:34 +02:00
e44b6bc272 Continued formatting of JCB code 2017-12-15 03:10:10 +02:00
8ac350e62b Fixed format typo that remove a string 2017-12-15 02:26:45 +02:00
d3cbea5c82 Major code formate to try and set a standared. Added four new fields for JavaScript files 2017-12-15 02:01:33 +02:00
c9cad158e6 Added a better tutorial about the developing work flow of JCB and so update the link in CONTRIBUTING.md 2017-12-14 17:08:35 +02:00
8ca7bc67ff Updated the PULL_REQUEST_TEMPLATE to use gh- instead of # in linking the issue to the pull reguest also removed some extra lines 2017-12-14 15:43:27 +02:00
95716e22cf Updated the compiler to also target JText::script() & Joomla.JText._() in language constant replacement. Added field counter. Resolved gh-198 2017-12-14 15:30:44 +02:00
20f5a083f0 Update the CONTRIBUTING to include a link to tutorials surrounding the code. 2017-12-13 17:35:54 +02:00
d37b0d367a Added Tidy warning to compiler and workaround so that the compiler can still work without the Tidy extension Resolved gh-197 2017-12-13 00:17:02 +02:00
258f7441d7 Resolved gh-194 to allow for [close & New] Button in linked views 2017-12-12 15:18:27 +02:00
ba07f1aae3 only add media if path is one value 2017-12-12 02:41:24 +02:00
27ff09226b execution order fix to insure folders are loaded 2017-12-12 02:28:35 +02:00
422cea1bed fixed mysql update values 2017-12-11 22:38:23 +02:00
5870f54900 Fixed some typos resolved gh-196 2017-12-11 13:18:33 +02:00
94175a4725 Resolve gh-181 to insure all urls added to xml is converting special characters with htmlspecialchars. 2017-12-10 21:20:29 +02:00
f900f65baa Renamed the uikit lib folders. Resolved the gh-188 by updateing the note. Resolved gh-92 by implementation of the library manager in the compiler. 2017-12-10 21:17:26 +02:00
b60d208d9e Merge branch 'staging' into decouple_libraries 2017-12-05 13:25:43 +02:00
6623da7a8d Resolve gh-111 2017-12-04 17:57:49 +02:00
fa83ea7bc9 moved the dispatcher out of the loop 2017-12-04 17:57:19 +02:00
87ba078dc8 fixed unintended formating. tweaked functions. resolved gh-189 2017-12-04 16:56:18 +02:00
9a6ad66e32 Fixed context 2017-12-03 19:53:05 -06:00
102ed837c2 automatic context based on available vars 2017-12-03 19:43:45 -06:00
b10b019494 Implement onContentPrepare 2017-12-03 19:24:53 -06:00
cc9a0e9c4c I missed a parameter 2017-12-03 18:50:21 -06:00
f19a279b16 revert to string search
to allow for malformed xml input
2017-12-03 16:13:36 -06:00
2661b62929 Revenge of Pretty Print
This time it's personal

Also, documented new functions
2017-12-03 13:12:56 -06:00
19d4d77305 Improved the get snippets area to load one library at a time. started on the adaptation of the compiler that is needed for the new libraries 2017-12-03 20:09:04 +02:00
07051d0955 pretty print
I've got pretty print much closer, but I haven't yet been able to produce it with a starting indent level.  The alternative is to run the file xml output through the pretty printer before writing the file.
2017-12-03 11:47:48 -06:00
8f3d573202 Code Formatting
Small things are killing me.....  some concatenation is wrapped in spaces, some isn't....  Some functions start braces on the 2nd line, some don't

I think this is the last one
2017-12-03 11:12:18 -06:00
ca4919f0f3 Code Formatting 2017-12-03 11:09:39 -06:00
c1675dbd30 Code formatting 2017-12-03 11:08:01 -06:00
55afca91a2 String Manipulation to SimpleXML and DOMDocument
I removed the string manipulation in favor of something more development friendly.  The drawback is that the resulting XML is not as pretty, although I did run the processed fields through DOMDocument pretty printer.  The entire resultant XML could be run through a pretty printer, but still won't achieve the tab indented node attributes.

The entire process could be made much more efficient, but this was just an initial conversion.
2017-12-03 02:02:11 -06:00
82df61aa4a added interface of the new decoupled libraries concept gh-92 2017-11-26 04:03:27 +02:00
9760ac86a3 Prevent getItem from clearing $item->params
Additional check added to params test to ensure that if parent::getItem values are not removed if present.
2017-11-24 01:22:17 -06:00
8c2618b691 Added github help files 2017-11-21 16:28:03 +02:00
e652d5b5b7 Added a fix to insure the contributor details are added to JCB original snippets. 2017-11-21 13:27:53 +02:00
5ae67c1ecc Added bulk updater to get snippets area. Added contributor details to snippets table. Imporved the installer to update the library matchup of old snippets. gh-92 2017-11-20 14:35:30 +02:00
eb43f1e3bc Finished the bulk get snippets UI area. Tweaked some of the get snipptes scripts, added some icons gh-92 2017-11-18 02:10:38 +02:00
dece9016ba Started with the bulk option to get snippets @ro-ot 2017-11-17 19:51:35 +02:00
268b609cea Completed the get snippets area so JCB community snippets can with easy be added to the local snippets gh-92. 2017-11-17 18:18:47 +02:00
f34e1b19f8 Added sharing of snippets option and started adding get snippets custom admin view gh-92. Fixed gh-153 published settings for categories. 2017-11-16 06:37:32 +02:00
1cc40dbfe4 updated Uikit v2 2017-11-12 02:33:10 +02:00
7d27af5d59 Added snippet types and libraries to snippets 2017-11-12 00:18:13 +02:00
efde286a1b Added Uikit3 to JCB in response gh-92 2017-11-11 06:33:51 +02:00
48d821628d Resolved gh-179 to unset fields that may not be in some DB's 2017-11-10 04:13:36 +02:00
4eac7d54f0 Resolved gh-169 to insure the addrulepath is also added to the default.xml file of site views. Improved the field types a little with adding the validation and message property to various field types. 2017-11-08 15:49:15 +02:00
1086 changed files with 94039 additions and 33644 deletions

20
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,20 @@
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:
1) Please watch [these tutorials](https://www.youtube.com/watch?v=lLOfx9YA7VQ&list=PLQRGFI8XZ_wsfz3NdKawCiYsALuZ-GhwJ)
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.
3) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
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.
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](https://www.vdm.io/report-security-issues). Please do not use the public forums for security issues.
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
PRs should usually be made to the `staging` branch as this contains the most recent version of the code.

17
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,17 @@
### Steps to reproduce the issue
### Expected result
### Actual result
### System information (as much as possible)
### Additional comments

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,16 @@
Pull Request for Issue gh- .
### Summary of Changes
### Testing Instructions
### Expected result
### Actual result
### Documentation Changes Required

8
.github/SUPPORT.md vendored Normal file
View File

@ -0,0 +1,8 @@
Where can you get support and help?
====================
* [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE);
* [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45);
* [The JCB! Wiki](https://github.com/vdm-io/Joomla-Component-Builder/wiki);
* [JCB Google Group](https://groups.google.com/a/vdm.io/d/forum/jcb);
* [Report a Security Issue](https://www.vdm.io/report-security-issues).

View File

@ -10,7 +10,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 safe 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 safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.3) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.7) 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)
@ -111,13 +111,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder) + *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 6th November, 2017 + *Last Build*: 17th December, 2017
+ *Version*: 2.6.3 + *Version*: 2.6.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **159529** + *Line count*: **178375**
+ *File count*: **1002** + *File count*: **1145**
+ *Folder count*: **165** + *Folder count*: **184**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
@ -126,5 +126,5 @@ Component Builder is mapped as a component in itself on my local development env
Come on buy me a coffee :) Come on buy me a coffee :)
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) * PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa * Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 * Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -10,7 +10,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 safe 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 safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.3) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.7) 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)
@ -111,13 +111,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder) + *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 6th November, 2017 + *Last Build*: 17th December, 2017
+ *Version*: 2.6.3 + *Version*: 2.6.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **159529** + *Line count*: **178375**
+ *File count*: **1002** + *File count*: **1145**
+ *Folder count*: **165** + *Folder count*: **184**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
@ -126,5 +126,5 @@ Component Builder is mapped as a component in itself on my local development env
Come on buy me a coffee :) Come on buy me a coffee :)
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) * PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa * Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 * Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -144,6 +144,7 @@
<action name="component_updates.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN_DESC" /> <action name="component_updates.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN_DESC" />
<action name="component_updates.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE_DESC" /> <action name="component_updates.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE_DESC" />
<action name="component_updates.version" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION_DESC" /> <action name="component_updates.version" title="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION_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_add" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC" />
@ -225,6 +226,13 @@
<action name="ftp.export" title="COM_COMPONENTBUILDER_FTPS_EXPORT" description="COM_COMPONENTBUILDER_FTPS_EXPORT_DESC" /> <action name="ftp.export" title="COM_COMPONENTBUILDER_FTPS_EXPORT" description="COM_COMPONENTBUILDER_FTPS_EXPORT_DESC" />
<action name="ftp.import" title="COM_COMPONENTBUILDER_FTPS_IMPORT" description="COM_COMPONENTBUILDER_FTPS_IMPORT_DESC" /> <action name="ftp.import" title="COM_COMPONENTBUILDER_FTPS_IMPORT" description="COM_COMPONENTBUILDER_FTPS_IMPORT_DESC" />
<action name="ftp.submenu" title="COM_COMPONENTBUILDER_FTPS_SUBMENU" description="COM_COMPONENTBUILDER_FTPS_SUBMENU_DESC" /> <action name="ftp.submenu" title="COM_COMPONENTBUILDER_FTPS_SUBMENU" description="COM_COMPONENTBUILDER_FTPS_SUBMENU_DESC" />
<action name="get_snippets.access" title="COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS_DESC" />
<action name="get_snippets.custom_admin_views" title="COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS_DESC" />
<action name="get_snippets.layouts" title="COM_COMPONENTBUILDER_GET_SNIPPETS_LAYOUTS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_LAYOUTS_BUTTON_ACCESS_DESC" />
<action name="get_snippets.libraries" title="COM_COMPONENTBUILDER_GET_SNIPPETS_LIBRARIES_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_LIBRARIES_BUTTON_ACCESS_DESC" />
<action name="get_snippets.site_views" title="COM_COMPONENTBUILDER_GET_SNIPPETS_SITE_VIEWS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_SITE_VIEWS_BUTTON_ACCESS_DESC" />
<action name="get_snippets.snippets" title="COM_COMPONENTBUILDER_GET_SNIPPETS_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="get_snippets.templates" title="COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS_DESC" />
<action name="help_document.access" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS_DESC" /> <action name="help_document.access" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS_DESC" />
<action name="help_document.batch" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_USE" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_USE_DESC" /> <action name="help_document.batch" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_USE" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_USE_DESC" />
<action name="help_document.create" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE_DESC" /> <action name="help_document.create" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE_DESC" />
@ -279,6 +287,7 @@
<action name="language.export" title="COM_COMPONENTBUILDER_LANGUAGES_EXPORT" description="COM_COMPONENTBUILDER_LANGUAGES_EXPORT_DESC" /> <action name="language.export" title="COM_COMPONENTBUILDER_LANGUAGES_EXPORT" description="COM_COMPONENTBUILDER_LANGUAGES_EXPORT_DESC" />
<action name="language.import" title="COM_COMPONENTBUILDER_LANGUAGES_IMPORT" description="COM_COMPONENTBUILDER_LANGUAGES_IMPORT_DESC" /> <action name="language.import" title="COM_COMPONENTBUILDER_LANGUAGES_IMPORT" description="COM_COMPONENTBUILDER_LANGUAGES_IMPORT_DESC" />
<action name="language.submenu" title="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_DESC" /> <action name="language.submenu" title="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_DESC" />
<action name="layout.get_snippets" title="COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="layout.access" title="COM_COMPONENTBUILDER_LAYOUTS_ACCESS" description="COM_COMPONENTBUILDER_LAYOUTS_ACCESS_DESC" /> <action name="layout.access" title="COM_COMPONENTBUILDER_LAYOUTS_ACCESS" description="COM_COMPONENTBUILDER_LAYOUTS_ACCESS_DESC" />
<action name="layout.batch" title="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE" description="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC" /> <action name="layout.batch" title="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE" description="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC" />
<action name="layout.dashboard_add" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC" /> <action name="layout.dashboard_add" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC" />
@ -287,6 +296,38 @@
<action name="layout.export" title="COM_COMPONENTBUILDER_LAYOUTS_EXPORT" description="COM_COMPONENTBUILDER_LAYOUTS_EXPORT_DESC" /> <action name="layout.export" title="COM_COMPONENTBUILDER_LAYOUTS_EXPORT" description="COM_COMPONENTBUILDER_LAYOUTS_EXPORT_DESC" />
<action name="layout.import" title="COM_COMPONENTBUILDER_LAYOUTS_IMPORT" description="COM_COMPONENTBUILDER_LAYOUTS_IMPORT_DESC" /> <action name="layout.import" title="COM_COMPONENTBUILDER_LAYOUTS_IMPORT" description="COM_COMPONENTBUILDER_LAYOUTS_IMPORT_DESC" />
<action name="layout.submenu" title="COM_COMPONENTBUILDER_LAYOUTS_SUBMENU" description="COM_COMPONENTBUILDER_LAYOUTS_SUBMENU_DESC" /> <action name="layout.submenu" title="COM_COMPONENTBUILDER_LAYOUTS_SUBMENU" description="COM_COMPONENTBUILDER_LAYOUTS_SUBMENU_DESC" />
<action name="library.access" title="COM_COMPONENTBUILDER_LIBRARIES_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_ACCESS_DESC" />
<action name="library.batch" title="COM_COMPONENTBUILDER_LIBRARIES_BATCH_USE" description="COM_COMPONENTBUILDER_LIBRARIES_BATCH_USE_DESC" />
<action name="library_config.access" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_ACCESS_DESC" />
<action name="library_config.batch" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_BATCH_USE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_BATCH_USE_DESC" />
<action name="library_config.create" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_CREATE_DESC" />
<action name="library_config.delete" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_DELETE_DESC" />
<action name="library_config.edit" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_DESC" />
<action name="library_config.edit.created_by" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_BY_DESC" />
<action name="library_config.edit.created" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_DATE_DESC" />
<action name="library_config.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_OWN_DESC" />
<action name="library_config.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_STATE_DESC" />
<action name="library_config.version" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_VERSION_DESC" />
<action name="library.create" title="COM_COMPONENTBUILDER_LIBRARIES_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_CREATE_DESC" />
<action name="library.dashboard_list" title="COM_COMPONENTBUILDER_LIBRARIES_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_LIBRARIES_DASHBOARD_LIST_DESC" />
<action name="library.delete" title="COM_COMPONENTBUILDER_LIBRARIES_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_DELETE_DESC" />
<action name="library.edit" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_DESC" />
<action name="library.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_OWN_DESC" />
<action name="library.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_STATE_DESC" />
<action name="library.version" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_VERSION_DESC" />
<action name="library_files_folders_urls.access" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_ACCESS_DESC" />
<action name="library_files_folders_urls.batch" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_BATCH_USE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_BATCH_USE_DESC" />
<action name="library_files_folders_urls.create" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_CREATE_DESC" />
<action name="library_files_folders_urls.delete" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_DELETE_DESC" />
<action name="library_files_folders_urls.edit" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_DESC" />
<action name="library_files_folders_urls.edit.created_by" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC" />
<action name="library_files_folders_urls.edit.created" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC" />
<action name="library_files_folders_urls.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_OWN_DESC" />
<action name="library_files_folders_urls.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_STATE_DESC" />
<action name="library_files_folders_urls.version" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC" />
<action name="library.submenu" title="COM_COMPONENTBUILDER_LIBRARIES_SUBMENU" description="COM_COMPONENTBUILDER_LIBRARIES_SUBMENU_DESC" />
<action name="library.get_snippets" title="COM_COMPONENTBUILDER_LIBRARY_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_LIBRARY_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_add" title="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC" />
@ -295,6 +336,16 @@
<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" />
<action name="site_view.import" title="COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT" description="COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT_DESC" /> <action name="site_view.import" title="COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT" description="COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT_DESC" />
<action name="site_view.submenu" title="COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU" description="COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU_DESC" /> <action name="site_view.submenu" title="COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU" description="COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU_DESC" />
<action name="snippet.get_snippets" title="COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="snippet.share_snippets" title="COM_COMPONENTBUILDER_SNIPPET_SHARE_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SNIPPET_SHARE_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="snippet_type.access" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_ACCESS" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_ACCESS_DESC" />
<action name="snippet_type.batch" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_BATCH_USE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_BATCH_USE_DESC" />
<action name="snippet_type.create" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_CREATE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_CREATE_DESC" />
<action name="snippet_type.delete" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_DELETE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_DELETE_DESC" />
<action name="snippet_type.edit" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_DESC" />
<action name="snippet_type.edit.own" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN_DESC" />
<action name="snippet_type.edit.state" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_STATE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_STATE_DESC" />
<action name="snippet_type.version" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_VERSION_DESC" />
<action name="snippet.access" title="COM_COMPONENTBUILDER_SNIPPETS_ACCESS" description="COM_COMPONENTBUILDER_SNIPPETS_ACCESS_DESC" /> <action name="snippet.access" title="COM_COMPONENTBUILDER_SNIPPETS_ACCESS" description="COM_COMPONENTBUILDER_SNIPPETS_ACCESS_DESC" />
<action name="snippet.batch" title="COM_COMPONENTBUILDER_SNIPPETS_BATCH_USE" description="COM_COMPONENTBUILDER_SNIPPETS_BATCH_USE_DESC" /> <action name="snippet.batch" title="COM_COMPONENTBUILDER_SNIPPETS_BATCH_USE" description="COM_COMPONENTBUILDER_SNIPPETS_BATCH_USE_DESC" />
<action name="snippet.dashboard_add" title="COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_ADD_DESC" /> <action name="snippet.dashboard_add" title="COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_ADD_DESC" />
@ -303,6 +354,7 @@
<action name="snippet.export" title="COM_COMPONENTBUILDER_SNIPPETS_EXPORT" description="COM_COMPONENTBUILDER_SNIPPETS_EXPORT_DESC" /> <action name="snippet.export" title="COM_COMPONENTBUILDER_SNIPPETS_EXPORT" description="COM_COMPONENTBUILDER_SNIPPETS_EXPORT_DESC" />
<action name="snippet.import" title="COM_COMPONENTBUILDER_SNIPPETS_IMPORT" description="COM_COMPONENTBUILDER_SNIPPETS_IMPORT_DESC" /> <action name="snippet.import" title="COM_COMPONENTBUILDER_SNIPPETS_IMPORT" description="COM_COMPONENTBUILDER_SNIPPETS_IMPORT_DESC" />
<action name="snippet.submenu" title="COM_COMPONENTBUILDER_SNIPPETS_SUBMENU" description="COM_COMPONENTBUILDER_SNIPPETS_SUBMENU_DESC" /> <action name="snippet.submenu" title="COM_COMPONENTBUILDER_SNIPPETS_SUBMENU" description="COM_COMPONENTBUILDER_SNIPPETS_SUBMENU_DESC" />
<action name="template.get_snippets" title="COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
<action name="template.access" title="COM_COMPONENTBUILDER_TEMPLATES_ACCESS" description="COM_COMPONENTBUILDER_TEMPLATES_ACCESS_DESC" /> <action name="template.access" title="COM_COMPONENTBUILDER_TEMPLATES_ACCESS" description="COM_COMPONENTBUILDER_TEMPLATES_ACCESS_DESC" />
<action name="template.batch" title="COM_COMPONENTBUILDER_TEMPLATES_BATCH_USE" description="COM_COMPONENTBUILDER_TEMPLATES_BATCH_USE_DESC" /> <action name="template.batch" title="COM_COMPONENTBUILDER_TEMPLATES_BATCH_USE" description="COM_COMPONENTBUILDER_TEMPLATES_BATCH_USE_DESC" />
<action name="template.dashboard_add" title="COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD_DESC" /> <action name="template.dashboard_add" title="COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD_DESC" />
@ -390,6 +442,15 @@
<action name="custom_code.access" title="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS_DESC" /> <action name="custom_code.access" title="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS_DESC" />
<action name="custom_code.version" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION_DESC" /> <action name="custom_code.version" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION_DESC" />
</section> </section>
<section name="library">
<action name="library.edit" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_DESC" />
<action name="library.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_OWN_DESC" />
<action name="library.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_STATE_DESC" />
<action name="library.create" title="COM_COMPONENTBUILDER_LIBRARIES_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_CREATE_DESC" />
<action name="library.delete" title="COM_COMPONENTBUILDER_LIBRARIES_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_DELETE_DESC" />
<action name="library.access" title="COM_COMPONENTBUILDER_LIBRARIES_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_ACCESS_DESC" />
<action name="library.version" title="COM_COMPONENTBUILDER_LIBRARIES_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_EDIT_VERSION_DESC" />
</section>
<section name="snippet"> <section name="snippet">
<action name="core.edit" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_DESC" /> <action name="core.edit" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_DESC" />
<action name="core.edit.state" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE_DESC" /> <action name="core.edit.state" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE_DESC" />
@ -582,6 +643,37 @@
<action name="component_files_folders.access" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS_DESC" /> <action name="component_files_folders.access" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS_DESC" />
<action name="component_files_folders.version" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION_DESC" /> <action name="component_files_folders.version" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION_DESC" />
</section> </section>
<section name="snippet_type">
<action name="snippet_type.edit" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_DESC" />
<action name="snippet_type.edit.own" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN_DESC" />
<action name="snippet_type.edit.state" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_STATE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_STATE_DESC" />
<action name="snippet_type.create" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_CREATE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_CREATE_DESC" />
<action name="snippet_type.delete" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_DELETE" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_DELETE_DESC" />
<action name="snippet_type.access" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_ACCESS" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_ACCESS_DESC" />
<action name="snippet_type.version" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_VERSION_DESC" />
</section>
<section name="library_config">
<action name="library_config.edit" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_DESC" />
<action name="library_config.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_OWN_DESC" />
<action name="library_config.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_STATE_DESC" />
<action name="library_config.edit.created_by" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_BY_DESC" />
<action name="library_config.edit.created" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_CREATED_DATE_DESC" />
<action name="library_config.create" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_CREATE_DESC" />
<action name="library_config.delete" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_DELETE_DESC" />
<action name="library_config.access" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_ACCESS_DESC" />
<action name="library_config.version" title="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_VERSION_DESC" />
</section>
<section name="library_files_folders_urls">
<action name="library_files_folders_urls.edit" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_DESC" />
<action name="library_files_folders_urls.edit.own" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_OWN" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_OWN_DESC" />
<action name="library_files_folders_urls.edit.state" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_STATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_STATE_DESC" />
<action name="library_files_folders_urls.edit.created_by" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC" />
<action name="library_files_folders_urls.edit.created" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC" />
<action name="library_files_folders_urls.create" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_CREATE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_CREATE_DESC" />
<action name="library_files_folders_urls.delete" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_DELETE" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_DELETE_DESC" />
<action name="library_files_folders_urls.access" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_ACCESS" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_ACCESS_DESC" />
<action name="library_files_folders_urls.version" title="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC" />
</section>
<section name="category.fields"> <section name="category.fields">
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" /> <action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" /> <action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />

View File

@ -25,3 +25,21 @@
/* CSS Document */ /* CSS Document */
#jform_snippet_chzn {
width: 100% !important;
}
.jform_snippet_input_width {
width: 90% !important;
}
#jform_main_get_chzn {
width: 100% !important;
}
.jform_main_get_input_width {
width: 90% !important;
}
#jform_dynamic_get_chzn {
width: 100% !important;
}
.jform_dynamic_get_input_width {
width: 90% !important;
}

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage get_snippets.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -25,3 +25,15 @@
/* CSS Document */ /* CSS Document */
#jform_snippet_chzn {
width: 100% !important;
}
.jform_snippet_input_width {
width: 90% !important;
}
#jform_dynamic_get_chzn {
width: 100% !important;
}
.jform_dynamic_get_input_width {
width: 90% !important;
}

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries_config.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries_files_folders_urls.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library_config.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,30 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library_files_folders_urls.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */
.control-group, .controls, .controls input[type="url"], .controls input[type="text"], .controls input[type="number"], .controls input[type="email"], .controls select, .controls textarea {
max-width: 100%;
}

View File

@ -25,3 +25,21 @@
/* CSS Document */ /* CSS Document */
#jform_snippet_chzn {
width: 100% !important;
}
.jform_snippet_input_width {
width: 90% !important;
}
#jform_main_get_chzn {
width: 100% !important;
}
.jform_main_get_input_width {
width: 90% !important;
}
#jform_dynamic_get_chzn {
width: 100% !important;
}
.jform_dynamic_get_input_width {
width: 90% !important;
}

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage snippet_type.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage snippet_types.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -25,3 +25,15 @@
/* CSS Document */ /* CSS Document */
#jform_snippet_chzn {
width: 100% !important;
}
.jform_snippet_input_width {
width: 90% !important;
}
#jform_dynamic_get_chzn {
width: 100% !important;
}
.jform_dynamic_get_input_width {
width: 90% !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,542 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage get_snippets.js
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* JS Document */
// start the moment the document is ready
jQuery(document).ready(function () {
// just get the available libraries
getLibraries(snippetsPath);
});
// add an ajax call tracker
var ajaxcall = null;
var fromLocal = false;
jQuery(document).ready(function(){
jQuery('body').on('click','.getreaction',function(){
// Ajax request
var btn = jQuery(this);
btn.prop('disabled', true);
setTimeout(function(){
btn.prop('disabled', false);
}, 3000);
var type = btn.data('type');
if ('getLibraries' === type) {
getLibraries(snippetsPath);
} else if ('getSnippets' === type) {
var name = btn.data('name');
getSnippets(snippetsPath, name);
} else if ('all' === type) {
var status = btn.data('status');
bulkSnippetGithub(status);
} else if ('bulk' === type) {
checkBulkSnippetGithub();
} else if ('get' === type) {
var path = btn.data('path');
var status = btn.data('status');
setSnippetGithub(path, status);
} else {
var path = btn.data('path');
getSnippetModal(path, type);
}
});
});
// load every thing once ready
jQuery(document).ajaxStop(function () {
if (0 === jQuery.active) {
//do something special
if ('snippets' === ajaxcall) {
setTimeout( function() {
jQuery('#snippets-github').html('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'</h1>');
jQuery('#snippets-display').show();
jQuery('#snippets-grid').trigger('display.uk.check');
jQuery('#loading').hide();
}, 1000);
}
}
});
// get the libraries
function getLibraries(path) {
var _paths = jQuery.jStorage.get('JCB-Snippets-Paths', null);
// always hide the snippets display
jQuery('#snippets-display').hide();
// always reset the grid
jQuery('#libraries-grid').html('');
// set the ajax scope
ajaxcall = 'libraries';
if (_paths) {
buildLibraries(_paths);
} else {
jQuery.get(path)
.success(function(paths) {
// load only this library paths
jQuery.jStorage.set('JCB-Snippets-Paths', paths, {TTL: expire});
buildLibraries(paths);
})
.error(function(jqXHR, textStatus, errorThrown) {
jQuery('#snippets-github').html(returnError);
});
}
}
// build the ibraries object
function buildLibraries(paths) {
var _temp = jQuery.jStorage.get('JCB-Libraries', null);
if (_temp) {
setLibraries(_temp);
} else {
var temp = {};
jQuery.each(paths.tree, function(key,value) {
if (value.path.match(".json$")) {
var libName = value.path.split(/ -(.+)/)[0];
libName = libName.trim()
temp[libName] = libName;
}
});
// load only this library paths
jQuery.jStorage.set('JCB-Libraries', temp, {TTL: expire});
setLibraries(temp);
}
}
// set the libraries
function setLibraries(names) {
// now load the lib buttons
jQuery.each(names, function(value) {
setLibrary(value);
});
setTimeout( function() {
jQuery('#snippets-github').html('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES')+'</h1>');
jQuery('#libraries-display').show();
jQuery('#libraries-grid').trigger('display.uk.check');
}, 1000);
}
// set the snippets
function setLibrary(name) {
// get useful ID
var keyID = getKeyID(name);
// build the library display
var html = '<div id="'+keyID+'-panel" class="uk-panel">';
html += '<div class="uk-panel uk-panel-box uk-width-1-1">';
html += '<h3 class="uk-panel-title">' + name + '</h3>';
html += '<hr />';
// set the data buttons
html += setLibButtons(name);
// close the box panel
html += '</div>';
html += '</div>';
// now we have the library
jQuery('#libraries-grid').append(html);
}
function setLibButtons(name) {
return '<button class="uk-button uk-button-small uk-button-success uk-width-1-1 getreaction" data-name="'+name+'" data-type="getSnippets" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-thumb-tack"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS')+'</span></button>';
}
// get the snippets
function getSnippets(path, libraryName) {
jQuery('#loading').show();
// get local values if set
var _paths = jQuery.jStorage.get('JCB-Snippets-Paths', null);
// always reset the grid
jQuery('#snippets-grid').html('');
// always hide libraries
jQuery('#libraries-display').hide();
// set the ajax scope
ajaxcall = 'snippets';
fromLocal = false;
if (_paths) {
setSnippets(_paths, libraryName);
jQuery('#snippets-github').html('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'</h1>');
} else {
jQuery.get(path)
.success(function(paths) {
// load only this library paths
jQuery.jStorage.set('JCB-Snippets-Paths', paths, {TTL: expire});
setSnippets(paths, libraryName);
})
.error(function(jqXHR, textStatus, errorThrown) {
jQuery('#snippets-github').html(returnError);
});
}
// only use if loading localy
if (fromLocal) {
jQuery('#snippets-display').show();
jQuery('#snippets-grid').trigger('display.uk.check');
jQuery('#loading').hide();
}
}
// set the snippets
function setSnippets(paths, libraryName) {
// set the ajax scope
ajaxcall = 'snippets';
jQuery.each(paths.tree, function(key,value) {
if (value.path.match(".json$") && value.path.match("^"+libraryName)) {
var _snippet = jQuery.jStorage.get(value.path, null);
if (_snippet) {
setSnippet(_snippet, value.path);
fromLocal = true;
} else {
jQuery.get(snippetPath+value.path)
.success(function(snippet) {
// convert the string to json.object
snippet = jQuery.parseJSON(snippet);
jQuery.jStorage.set(value.path, snippet, {TTL: expire});
setSnippet(snippet, value.path);
})
.error(function(jqXHR, textStatus, errorThrown) {
// we could do more
});
}
}
});
}
// set the snippets
function setSnippet(snippet, key) {
// get useful ID
var keyID = getKeyID(key);
// get the status
var status = getSnippetStatus(snippet, key);
// add to bulk updater
if ('equal' !== status) {
bulkItems[status].push(key);
}
// build the snippet display
var html = '<div id="'+keyID+'-panel" class="uk-panel" data-uk-filter="'+status+'" data-snippet-libraries="'+snippet.library+'" data-snippet-types="'+snippet.type+'" data-snippet-name="'+snippet.name+'">';
html += '<div class="uk-panel uk-panel-box uk-width-1-1">';
html += '<div class="uk-panel-badge uk-badge" ><a id="'+keyID+'-badge" href="#'+status+'-meaning" data-uk-offcanvas class="uk-text-uppercase uk-text-contrast"><i class="uk-icon-info"></i> '+status+'</a></div><br />';
html += '<h3 class="uk-panel-title">' + snippet.library+ ' - (' + snippet.type + ') ' + snippet.name + '</h3>';
html += snippet.heading + '<hr />';
// set the data buttons
html += setDataButtons(snippet, key, status);
// set the snippet ref button
html += setRefButtons(snippet, key, status, keyID);
// set the contributor buttons
html += setContributorButtons(snippet, key);
// close the box panel
html += '</div>';
html += '</div>';
// now we have the snippet
jQuery('#snippets-grid').append(html);
}
// set the snippet status
function getSnippetStatus(snippet, key) {
// check if JCB already has this snippet
if(local_snippets.hasOwnProperty(key)){
// first get local time stamp
var local_created = strtotime(local_snippets[key].created);
var local_modified = strtotime(local_snippets[key].modified);
// now get github time stamps
var created = strtotime(snippet.created);
var modified = strtotime(snippet.modified);
// work out the status
if (local_created == created) {
if (local_modified == modified) {
return 'equal';
} else if (local_modified > modified) {
return 'ahead';
} else if (local_modified < modified) {
return 'behind';
}
}
return 'diverged';
}
return 'new';
}
function setDataButtons(snippet, key, status) {
var html = '<div class="uk-button-group uk-width-1-1 uk-margin-small-bottom">';
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="usage" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-info"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_USAGE')+'</span></button>';
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="description" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-sticky-note-o"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_DESCRIPTION')+'</span></button>';
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="snippet" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-code"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET')+'</span></button>';
html += '</div>';
// return data buttons
return html;
}
function setRefButtons(snippet, key, status, keyID) {
var html = '<div><a class="uk-button uk-button-mini uk-button-success uk-margin-small-bottom uk-width-1-1" href="'+snippet.url+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL')+'"><i class="uk-icon-external-link"></i> ' + snippet.name + '</a></div>';
// set the update button
html += '<div>';
if ('equal' !== status) {
if ('new' === status) {
var tooltip = Joomla.JText._('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY');
} else {
var tooltip = Joomla.JText._('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION');
}
html += '<button id="'+keyID+'-getbutton" class="uk-button uk-button-small uk-button-primary uk-width-1-1 uk-margin-small-bottom getreaction" data-status="'+status+'" data-path="'+key+'" data-type="get" title="'+tooltip+'"><i class="uk-icon-cloud-download"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_GET_SNIPPET')+'</button>';
} else {
html += '<button class="uk-button uk-button-small uk-width-1-1 uk-margin-small-bottom" type="button" disabled title="'+Joomla.JText._('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION')+'"><i class="uk-icon-check-square-o"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_LOCAL_SNIPPET')+'</button>';
}
html += '</div>';
// return data buttons
return html;
}
function setContributorButtons(snippet, key) {
// set the contributor name
if (snippet.contributor_company) {
var contributor_name = snippet.contributor_company;
} else if (snippet.contributor_name) {
var contributor_name = snippet.contributor_name;
} else {
var contributor_name = Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY');
}
// set the contributor url
if (snippet.contributor_website) {
var contributor_url = snippet.contributor_website;
} else if (snippet.contributor_email) {
var contributor_url = 'mailto:'+snippet.contributor_email;
} else {
var contributor_url = 'https://github.com/vdm-io/Joomla-Component-Builder-Snippets';
}
var html = '<div class="uk-button-group uk-width-1-1">';
html += '<button class="uk-button uk-button-primary uk-width-1-10 uk-button-mini getreaction" data-type="contributor" data-path="'+key+'" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS')+'"><i class="uk-icon-user"></i></button>';
html += '<a class="uk-button uk-button-primary uk-width-5-10 uk-button-mini" href="'+contributor_url+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR')+'"><i class="uk-icon-external-link"></i> ' + contributor_name + '</a>';
html += '<a class="uk-button uk-button-primary uk-width-4-10 uk-button-mini" href="https://github.com/vdm-io/Joomla-Component-Builder-Snippets/blame/master/'+key+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET')+'"><i class="uk-icon-external-link"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_BLAME')+'</a>';
html += '</div>';
// return contributor buttons
return html;
}
// do a bulk update
function checkBulkSnippetGithub() {
// check if there is new items
if (bulkItems.new.length === 0) {
jQuery('#bulk-button-new').prop('disabled', true);
jQuery('#bulk-button-new').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME'));
jQuery('#bulk-notice-new').show();
}
// check if there is diverged items
if (bulkItems.diverged.length === 0) {
jQuery('#bulk-button-diverged').prop('disabled', true);
jQuery('#bulk-button-diverged').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME'));
jQuery('#bulk-notice-diverged').show();
}
// check if there is ahead items
if (bulkItems.ahead.length === 0) {
jQuery('#bulk-button-ahead').prop('disabled', true);
jQuery('#bulk-button-ahead').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME'));
jQuery('#bulk-notice-ahead').show();
}
// check if there is behind items
if (bulkItems.behind.length === 0) {
jQuery('#bulk-button-behind').prop('disabled', true);
jQuery('#bulk-button-behind').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME'));
jQuery('#bulk-notice-behind').show();
}
// check if all we should close the all button
if (bulkItems.behind.length === 0 && bulkItems.new.length === 0 && bulkItems.ahead.length === 0 && bulkItems.diverged.length === 0) {
jQuery('#bulk-button-all').prop('disabled', true);
jQuery('#bulk-button-all').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME'));
jQuery('#bulk-notice-all').show();
}
}
// do a bulk update
function bulkSnippetGithub(status) {
// if all then trigger those with values
if ('all' === status) {
bulkSnippetGithub('behind');
bulkSnippetGithub('new');
bulkSnippetGithub('ahead');
bulkSnippetGithub('diverged');
} else if (bulkItems[status].length > 0) {
jQuery.each(bulkItems[status], function(i, key){
setTimeout(function(){
doBulkUpdate_server(key, status).done(function(result) {
if (result.message) {
// only show errors
if ('error' === result.status || 'warning' === result.status) {
UIkit.notify(result.message, {status: result.status});
}
// update local items
if ('success' === result.status) {
// get key ID
var keyID = getKeyID(key);
// update snippet if we can
updateSnippetDisplay(keyID, 'equal');
}
} else {
UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'), {status:'danger'});
}
});
}, 200);
});
// reset array
bulkItems[status].length = 0;
// update the buttons (since we only do the bulk update once)
checkBulkSnippetGithub();
}
}
function doBulkUpdate_server(path, status) {
// set the ajax scope
ajaxcall = null;
var getUrl = "index.php?option=com_[[[component]]]&task=ajax.setSnippetGithub&format=json";
if (token.length > 0 && path.length > 0 && status.length > 0) {
var request = 'token='+token+'&path='+path+'&status='+status;
}
return jQuery.ajax({
type: 'POST',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
}
// set the snippet from gitHub
function setSnippetGithub(key, status) {
var message = getConfirmUpdate(status);
UIkit.modal.confirm(message, function(){
// will be executed on confirm.
setSnippetGithub_server(key, status).done(function(result) {
if (result.message) {
UIkit.notify(result.message, {status: result.status});
if ('success' === result.status) {
// get key ID
var keyID = getKeyID(key);
// update snippet if we can
updateSnippetDisplay(keyID, 'equal');
}
} else {
UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'), {status:'danger'});
}
});
});
}
function setSnippetGithub_server(path, status) {
// set the ajax scope
ajaxcall = null;
var getUrl = "index.php?option=com_[[[component]]]&task=ajax.setSnippetGithub&format=json";
if (token.length > 0 && path.length > 0 && status.length > 0) {
var request = 'token='+token+'&path='+path+'&status='+status;
}
return jQuery.ajax({
type: 'POST',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
}
// update the snippet display
function updateSnippetDisplay(keyID, status) {
// update badge
jQuery('#'+keyID+'-badge').html('<i class="uk-icon-info"></i> ' +status);
jQuery('#'+keyID+'-badge').attr('href' , '#'+status+'-meaning');
// update button
if ('equal' === status) {
// update notice
jQuery('#'+keyID+'-getbutton').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION'));
jQuery('#'+keyID+'-getbutton').prop('disabled', true);
jQuery('#'+keyID+'-getbutton').html('<i class="uk-icon-check-square-o"></i> ' + Joomla.JText._('COM_COMPONENTBUILDER_LOCAL_SNIPPET'));
// counter delay just incase
setTimeout(function(){
jQuery('#'+keyID+'-getbutton').prop('disabled', true);
}, 2000);
}
// update the data filter
jQuery('#'+keyID+'-panel').attr('data-uk-filter', status);
// tell the grid to update
jQuery('#snippets-grid').trigger('display.uk.check');
}
// set the modal
function getSnippetModal(key, type) {
// set the ajax scope
ajaxcall = 'snippets';
var _snippet = jQuery.jStorage.get(key, null);
if (_snippet) {
// show modal
showSnippetModal(_snippet, type);
} else {
jQuery.get('https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder-Snippets/master/'+key)
.success(function(snippet) {
// convert the string to json.object
snippet = jQuery.parseJSON(snippet);
jQuery.jStorage.set(key, snippet, {TTL: expire});
// show modal
showSnippetModal(snippet, type);
})
.error(function(jqXHR, textStatus, errorThrown) {
// we could do more
});
}
}
// show the modal
function showSnippetModal(snippet, type) {
var html = '<div class="uk-modal-dialog uk-modal-dialog-lightbox">';
html += '<a href="" class="uk-modal-close uk-close uk-close-alt"></a>';
html += '<h3>' + snippet.library + ' - (' + snippet.type + ') ' + snippet.name + '</h3>';
if ('contributor' === type) {
html += '<dl class="uk-description-list-line">';
html += '<dt><i class="uk-icon-institution"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_COMPANY_NAME')+'</dt>';
html += '<dd>'+snippet.contributor_company+'</dd>';
html += '<dt><i class="uk-icon-user"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_NAME')+'</dt>';
html += '<dd>'+snippet.contributor_name+'</dd>';
html += '<dt><i class="uk-icon-envelope-o"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_EMAIL')+'</dt>';
html += '<dd>'+snippet.contributor_email+'</dd>';
html += '<dt><i class="uk-icon-laptop"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_WEBSITE')+'</dt>';
html += '<dd>'+snippet.contributor_website+'</dd>';
html += '</dl>';
} else {
html += '<br /><textarea class="uk-width-1-1" rows="15" readonly>'+snippet[type]+'</textarea>';
}
html += '<br /><small>C: ' + snippet.created + ' | M: ' + snippet.modified + '</small>';
html += '</div>';
// get current page position
var scroll = jQuery(window).scrollTop();
// add html to modal
var modal = UIkit.modal.blockUI(html, {center:true, bgclose:true}).on({
'hide.uk.modal': function(){
// scroll fix since the modal pops to the top of the page
jQuery(window).scrollTop(scroll);
}
});
// show modal
modal.show();
}
// get key ID
function getKeyID(key) {
// get useful ID
var keyID = key.replace('-', '');
keyID = keyID.replace('.json', '');
keyID = keyID.replace(/\s+/ig, '-');
keyID = keyID.replace(/\(/g, '');
keyID = keyID.replace(/\)/g, '');
// return the id build
return keyID;
}

View File

@ -40,101 +40,101 @@ class ###Component###Model###Component### extends JModelList
{ {
public function getIcons() public function getIcons()
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// reset icon array // reset icon array
$icons = array(); $icons = array();
// view groups array // view groups array
$viewGroups = array( $viewGroups = array(
'main' => array(###DASHBOARDICONS###) 'main' => array(###DASHBOARDICONS###)
);###DASHBOARDICONACCESS### );###DASHBOARDICONACCESS###
foreach($viewGroups as $group => $views) foreach($viewGroups as $group => $views)
{ {
$i = 0; $i = 0;
if (###Component###Helper::checkArray($views)) if (###Component###Helper::checkArray($views))
{ {
foreach($views as $view) foreach($views as $view)
{ {
$add = false; $add = false;
if (strpos($view,'.') !== false) if (strpos($view,'.') !== false)
{ {
$dwd = explode('.', $view); $dwd = explode('.', $view);
if (count($dwd) == 3) if (count($dwd) == 3)
{ {
list($type, $name, $action) = $dwd; list($type, $name, $action) = $dwd;
} }
elseif (count($dwd) == 2) elseif (count($dwd) == 2)
{ {
list($type, $name) = $dwd; list($type, $name) = $dwd;
$action = false; $action = false;
} }
if ($action) if ($action)
{ {
$viewName = $name; $viewName = $name;
switch($action) switch($action)
{ {
case 'add': case 'add':
$url ='index.php?option=com_###component###&view='.$name.'&layout=edit'; $url ='index.php?option=com_###component###&view='.$name.'&layout=edit';
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action; $alt = $name.'&nbsp;'.$action;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD'; $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
$add = true; $add = true;
break; break;
default: default:
$url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name; $url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name;
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action; $alt = $name.'&nbsp;'.$action;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U'); $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U');
break; break;
} }
} }
else else
{ {
$viewName = $name; $viewName = $name;
$alt = $name; $alt = $name;
$url = 'index.php?option=com_###component###&view='.$name; $url = 'index.php?option=com_###component###&view='.$name;
$image = $name.'.'.$type; $image = $name.'.'.$type;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U'); $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U');
$hover = false; $hover = false;
} }
} }
else else
{ {
$viewName = $view; $viewName = $view;
$alt = $view; $alt = $view;
$url = 'index.php?option=com_###component###&view='.$view; $url = 'index.php?option=com_###component###&view='.$view;
$image = $view.'.png'; $image = $view.'.png';
$name = ucwords($view).'<br /><br />'; $name = ucwords($view).'<br /><br />';
$hover = false; $hover = false;
} }
// first make sure the view access is set // first make sure the view access is set
if (###Component###Helper::checkArray($viewAccess)) if (###Component###Helper::checkArray($viewAccess))
{ {
// setup some defaults // setup some defaults
$dashboard_add = false; $dashboard_add = false;
$dashboard_list = false; $dashboard_list = false;
$accessTo = ''; $accessTo = '';
$accessAdd = ''; $accessAdd = '';
// acces checking start // acces checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false; $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers // set main controllers
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false; $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false; $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
// check for adding access // check for adding access
if ($add && $accessCreate) if ($add && $accessCreate)
{ {
$accessAdd = $viewAccess[$viewName.'.create']; $accessAdd = $viewAccess[$viewName.'.create'];
} }
elseif ($add) elseif ($add)
{ {
$accessAdd = 'core.create'; $accessAdd = 'core.create';
} }
// check if acces to view is set // check if acces to view is set
if ($accessAccess) if ($accessAccess)
{ {
$accessTo = $viewAccess[$viewName.'.access']; $accessTo = $viewAccess[$viewName.'.access'];
} }
// set main access controllers // set main access controllers
if ($accessDashboard_add) if ($accessDashboard_add)
{ {
@ -144,65 +144,65 @@ class ###Component###Model###Component### extends JModelList
{ {
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
} }
if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo)) if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (###Component###Helper::checkString($accessTo)) elseif (###Component###Helper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (###Component###Helper::checkString($accessAdd)) elseif (###Component###Helper::checkString($accessAdd))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
$i++; $i++;
} }
} }
else else
{ {
$icons[$group][$i] = false; $icons[$group][$i] = false;
} }
} }
return $icons; return $icons;

View File

@ -74,15 +74,15 @@ class ###Component###View###Component### extends JViewLegacy
$canDo = ###Component###Helper::getActions('###component###'); $canDo = ###Component###Helper::getActions('###component###');
JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###component###'); $help_url = ###Component###Helper::getHelpUrl('###component###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
if ($canDo->get('core.admin') || $canDo->get('core.options')) if ($canDo->get('core.admin') || $canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
} }

View File

@ -37,10 +37,10 @@ abstract class ###Component###Helper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -55,22 +55,22 @@ abstract class ###Component###Helper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">'; $link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
elseif($params->get("useContributor".$nr) == 2) elseif($params->get("useContributor".$nr) == 2)
{ {
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">'; $link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
else else
{ {
$link_front = ''; $link_front = '';
$link_back = ''; $link_back = '';
} }
@ -86,10 +86,10 @@ abstract class ###Component###Helper
**/ **/
public static function addSubmenu($submenu) public static function addSubmenu($submenu)
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// load the submenus to sidebar // load the submenus to sidebar
###SUBMENU### ###SUBMENU###
}###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL### }###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL###
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###')
@ -182,9 +182,9 @@ abstract class ###Component###Helper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -206,15 +206,15 @@ abstract class ###Component###Helper
} }
return (string) implode($sperator,$result); return (string) implode($sperator,$result);
} }
return (string) json_decode($value); return (string) json_decode($value);
} }
return $value; return $value;
} }
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -227,7 +227,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -244,33 +244,33 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
} }
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_###component###', 'component'); $actions = JAccess::getActions('com_###component###', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback= true; $fallback= true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -349,17 +349,17 @@ abstract class ###Component###Helper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -650,6 +650,31 @@ abstract class ###Component###Helper
return false; return false;
} }
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
**/
public static function isConnected()
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443)
if ($connected)
{
//action when connected
$is_conn = true;
fclose($connected);
}
else
{
//action in connection failure
$is_conn = false;
}
return $is_conn;
}
public static function mergeArrays($arrays) public static function mergeArrays($arrays)
{ {
if(self::checkArray($arrays)) if(self::checkArray($arrays))
@ -715,8 +740,8 @@ abstract class ###Component###Helper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -739,12 +764,12 @@ abstract class ###Component###Helper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -765,21 +790,21 @@ abstract class ###Component###Helper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -788,14 +813,14 @@ abstract class ###Component###Helper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
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)) if (self::checkString($var))
{ {
@ -806,11 +831,11 @@ abstract class ###Component###Helper
return self::shorten($string,$length); return self::shorten($string,$length);
} }
return $string; return $string;
} }
else else
{ {
return ''; return '';
} }
}###HELPER_LICENSE_LOCK### }###HELPER_LICENSE_LOCK###
public static function replaceNumbers($string) public static function replaceNumbers($string)

View File

@ -191,7 +191,6 @@ abstract class ###Component###Email
// load the bounce email as sender if set // load the bounce email as sender if set
if (!is_null($bounce_email)) if (!is_null($bounce_email))
{ {
$mail->Sender = $bounce_email; $mail->Sender = $bounce_email;
} }

View File

@ -37,9 +37,9 @@ abstract class ###Component###Helper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -69,10 +69,10 @@ abstract class ###Component###Helper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -87,9 +87,9 @@ abstract class ###Component###Helper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
@ -368,7 +368,7 @@ abstract class ###Component###Helper
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -381,7 +381,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -398,7 +398,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
@ -407,24 +407,24 @@ abstract class ###Component###Helper
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_###component###', 'component'); $actions = JAccess::getActions('com_###component###', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback = true; $fallback = true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -503,17 +503,17 @@ abstract class ###Component###Helper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -645,6 +645,31 @@ abstract class ###Component###Helper
return false; return false;
} }
/**
* Check if we are connected
* Thanks https://stackoverflow.com/a/4860432/1429677
*
* @returns bool true on success
**/
public static function isConnected()
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443)
if ($connected)
{
//action when connected
$is_conn = true;
fclose($connected);
}
else
{
//action in connection failure
$is_conn = false;
}
return $is_conn;
}
public static function mergeArrays($arrays) public static function mergeArrays($arrays)
{ {
if(self::checkArray($arrays)) if(self::checkArray($arrays))
@ -710,8 +735,8 @@ abstract class ###Component###Helper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -734,12 +759,12 @@ abstract class ###Component###Helper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -760,21 +785,21 @@ abstract class ###Component###Helper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -783,11 +808,11 @@ abstract class ###Component###Helper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)

View File

@ -105,10 +105,10 @@ class ###Component###Controller###View### extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -102,13 +102,13 @@ class ###Component###Controller###View### extends JControllerForm
$append = ''; $append = '';
if ($refid) if ($refid)
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -42,7 +42,7 @@ class ###Component###Controller extends JControllerLegacy
* *
* @return void * @return void
*/ */
function display($cachable = false, $urlparams = false) function display($cachable = false, $urlparams = false)
{ {
// set default view if not set // set default view if not set
$view = $this->input->getCmd('view', '###Component###'); $view = $this->input->getCmd('view', '###Component###');
@ -51,58 +51,58 @@ class ###Component###Controller extends JControllerLegacy
$id = $this->input->getInt('id'); $id = $this->input->getInt('id');
// Check for edit form. // Check for edit form.
if(###Component###Helper::checkArray($data)) if(###Component###Helper::checkArray($data))
{ {
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id)) if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id))
{ {
// Somehow the person just went to the form - we don't allow that. // Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error'); $this->setMessage($this->getError(), 'error');
// check if item was opend from other then its own list view // check if item was opend from other then its own list view
$ref = $this->input->getCmd('ref', 0); $ref = $this->input->getCmd('ref', 0);
$refid = $this->input->getInt('refid', 0); $refid = $this->input->getInt('refid', 0);
// set redirect // set redirect
if ($refid > 0 && ###Component###Helper::checkString($ref)) if ($refid > 0 && ###Component###Helper::checkString($ref))
{ {
// redirect to item of ref // redirect to item of ref
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
} }
elseif (###Component###Helper::checkString($ref)) elseif (###Component###Helper::checkString($ref))
{ {
// redirect to ref // redirect to ref
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
} }
else else
{ {
// normal redirect back to the list view // normal redirect back to the list view
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false)); $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false));
} }
return false; return false;
} }
} }
return parent::display($cachable, $urlparams); return parent::display($cachable, $urlparams);
} }
protected function getViewRelation($view) protected function getViewRelation($view)
{ {
if (###Component###Helper::checkString($view)) if (###Component###Helper::checkString($view))
{ {
$views = array(###VIEWARRAY### $views = array(###VIEWARRAY###
); );
// check if this is a list view // check if this is a list view
if (in_array($view,$views)) if (in_array($view,$views))
{ {
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
} }
// check if it is an edit view // check if it is an edit view
elseif (array_key_exists($view,$views)) elseif (array_key_exists($view,$views))
{ {
return array('edit' => true, 'view' => $view, 'views' => $views[$view]); return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
} }
} }
return false; return false;
} }
} }

View File

@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token) if($token == $call_token)
{ {
$task = $this->getTask(); $task = $this->getTask();
switch($task) switch($task)
{###AJAX_INPUT_RETURN### {###AJAX_INPUT_RETURN###
} }
} }
else else
{ {
if($callback = $jinput->get('callback', null, 'CMD')) if($callback = $jinput->get('callback', null, 'CMD'))
{ {
echo $callback."(".json_encode(false).");"; echo $callback."(".json_encode(false).");";
} }
else else
{ {
echo "(".json_encode(false).");"; echo "(".json_encode(false).");";
} }
} }

View File

@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token) if($token == $call_token)
{ {
$task = $this->getTask(); $task = $this->getTask();
switch($task) switch($task)
{###AJAX_SITE_INPUT_RETURN### {###AJAX_SITE_INPUT_RETURN###
} }
} }
else else
{ {
if($callback = $jinput->get('callback', null, 'CMD')) if($callback = $jinput->get('callback', null, 'CMD'))
{ {
echo $callback."(".json_encode(false).");"; echo $callback."(".json_encode(false).");";
} }
else else
{ {
echo "(".json_encode(false).");"; echo "(".json_encode(false).");";
} }
} }

View File

@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy
// Check Token! // Check Token!
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($user->id != 0 && $token == $call_token){ if($user->id != 0 && $token == $call_token)
{
$task = $this->getTask(); $task = $this->getTask();
switch($task){ switch($task){
case 'getText': case 'getText':
@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy
$result = ''; $result = '';
} }
echo $result; echo $result;
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
catch(Exception $e) catch(Exception $e)
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
break; break;
} }
} }
else else
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
} }
protected function getHelpDocumentText($id) protected function getHelpDocumentText($id)
{ {
$db = JFactory::getDbo(); $db = JFactory::getDbo();
$query = $db->getQuery(true); $query = $db->getQuery(true);

View File

@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy
// Check Token! // Check Token!
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token){ if($token == $call_token)
{
$task = $this->getTask(); $task = $this->getTask();
switch($task){ switch($task){
case 'getText': case 'getText':
@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy
$result = ''; $result = '';
} }
echo $result; echo $result;
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
catch(Exception $e) catch(Exception $e)
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
break; break;
} }
} }
else else
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
} }
protected function getHelpDocumentText($id) protected function getHelpDocumentText($id)
{ {
$db = JFactory::getDbo(); $db = JFactory::getDbo();
$query = $db->getQuery(true); $query = $db->getQuery(true);

View File

@ -42,18 +42,18 @@ class ###Component###Controller extends JControllerLegacy
* *
* @return void * @return void
*/ */
function display($cachable = false, $urlparams = false) function display($cachable = false, $urlparams = false)
{ {
// set default view if not set // set default view if not set
$view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
$isEdit = $this->checkEditView($view); $isEdit = $this->checkEditView($view);
$layout = $this->input->get('layout', null, 'WORD'); $layout = $this->input->get('layout', null, 'WORD');
$id = $this->input->getInt('id'); $id = $this->input->getInt('id');
$cachable = true; $cachable = true;
// Check for edit form. // Check for edit form.
if($isEdit) if($isEdit)
{ {
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id)) if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
{ {
// Somehow the person just went to the form - we don't allow that. // Somehow the person just went to the form - we don't allow that.
@ -70,7 +70,6 @@ class ###Component###Controller extends JControllerLegacy
} }
elseif (###Component###Helper::checkString($ref)) elseif (###Component###Helper::checkString($ref))
{ {
// redirect to ref // redirect to ref
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
} }
@ -81,23 +80,23 @@ class ###Component###Controller extends JControllerLegacy
} }
return false; return false;
} }
} }
return parent::display($cachable, $urlparams); return parent::display($cachable, $urlparams);
} }
protected function checkEditView($view) protected function checkEditView($view)
{ {
if (###Component###Helper::checkString($view)) if (###Component###Helper::checkString($view))
{ {
$views = array(###SITE_EDIT_VIEW_ARRAY### $views = array(###SITE_EDIT_VIEW_ARRAY###
); );
// check if this is a edit view // check if this is a edit view
if (in_array($view,$views)) if (in_array($view,$views))
{ {
return true; return true;
} }
} }
return false; return false;
} }
} }

View File

@ -42,7 +42,7 @@ class ###Component###Controller###SView### extends JControllerLegacy
parent::__construct($config); parent::__construct($config);
} }
public function dashboard() public function dashboard()
{ {
$this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); $this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
return; return;

View File

@ -82,7 +82,7 @@ class ###Component###Model###View### extends JModelAdmin
{###LICENSE_LOCKED_CHECK### {###LICENSE_LOCKED_CHECK###
if ($item = parent::getItem($pk)) if ($item = parent::getItem($pk))
{ {
if (!empty($item->params)) if (!empty($item->params) && !is_array($item->params))
{ {
// Convert the params field to an array. // Convert the params field to an array.
$registry = new Registry; $registry = new Registry;

View File

@ -82,7 +82,7 @@ class ###Component###Model###View### extends JModelAdmin
{###LICENSE_LOCKED_CHECK### {###LICENSE_LOCKED_CHECK###
if ($item = parent::getItem($pk)) if ($item = parent::getItem($pk))
{ {
if (!empty($item->params)) if (!empty($item->params) && !is_array($item->params))
{ {
// Convert the params field to an array. // Convert the params field to an array.
$registry = new Registry; $registry = new Registry;

View File

@ -49,11 +49,11 @@ class ###Component###Model###SView### extends JModelItem
* *
* @var strings * @var strings
*/ */
protected $user; protected $user;
protected $userId; protected $userId;
protected $guest; protected $guest;
protected $groups; protected $groups;
protected $levels; protected $levels;
protected $app; protected $app;
protected $input; protected $input;
protected $uikitComp; protected $uikitComp;
@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
*/ */
protected function populateState() protected function populateState()
{ {
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
// Get the item main id // Get the item main id
$id = $this->input->getInt('id', null); $id = $this->input->getInt('id', null);
$this->setState('###sview###.id', $id); $this->setState('###sview###.id', $id);
// Load the parameters. // Load the parameters.
@ -94,21 +94,21 @@ class ###Component###Model###SView### extends JModelItem
public function getItem($pk = null) public function getItem($pk = null)
{ {
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// check if this user has permission to access item // check if this user has permission to access item
if (!$this->user->authorise('###sview###.access', 'com_###component###')) if (!$this->user->authorise('###sview###.access', 'com_###component###'))
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error'); $app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct to cPanel/default view // redirect away if not a correct to cPanel/default view
$app->redirect('index.php?option=com_###component###'); $app->redirect('index.php?option=com_###component###');
return false; return false;
} }
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true; $this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM###

View File

@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
*/ */
protected function populateState() protected function populateState()
{ {
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
// Get the itme main id // Get the itme main id
$id = $this->input->getInt('id', null); $id = $this->input->getInt('id', null);
$this->setState('###sview###.id', $id); $this->setState('###sview###.id', $id);
// Load the parameters. // Load the parameters.
@ -95,13 +95,13 @@ class ###Component###Model###SView### extends JModelItem
*/ */
public function getItem($pk = null) public function getItem($pk = null)
{ {
$this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS### $this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true; $this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM###

View File

@ -92,10 +92,10 @@ class ###Component###ModelImport extends JModelLegacy
public function import() public function import()
{ {
$this->setState('action', 'import'); $this->setState('action', 'import');
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = null; $package = null;
$continue = false; $continue = false;
// get import type // get import type
$this->getType = $app->input->getString('gettype', NULL); $this->getType = $app->input->getString('gettype', NULL);
// get import type // get import type
@ -150,7 +150,7 @@ class ###Component###ModelImport extends JModelLegacy
// first link data to table headers // first link data to table headers
if(!$continue){ if(!$continue){
$package = json_encode($package); $package = json_encode($package);
$session->set('package', $package); $session->set('package', $package);
$session->set('dataType', $this->dataType); $session->set('dataType', $this->dataType);
$session->set('hasPackage', true); $session->set('hasPackage', true);
@ -202,8 +202,8 @@ class ###Component###ModelImport extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -230,9 +230,9 @@ class ###Component###ModelImport extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -263,8 +263,8 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -294,8 +294,8 @@ class ###Component###ModelImport extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -308,8 +308,8 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -348,7 +348,7 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -361,15 +361,15 @@ class ###Component###ModelImport extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -408,8 +408,8 @@ class ###Component###ModelImport extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
@ -472,11 +472,11 @@ class ###Component###ModelImport extends JModelLegacy
if(###Component###Helper::checkArray($data['array'])) if(###Component###Helper::checkArray($data['array']))
{ {
// get user object // get user object
$user = JFactory::getUser(); $user = JFactory::getUser();
// remove header if it has headers // remove header if it has headers
$id_key = $data['target_headers']['id']; $id_key = $data['target_headers']['id'];
$published_key = $data['target_headers']['published']; $published_key = $data['target_headers']['published'];
$ordering_key = $data['target_headers']['ordering']; $ordering_key = $data['target_headers']['ordering'];
// get the first array set // get the first array set
$firstSet = reset($data['array']); $firstSet = reset($data['array']);
@ -494,13 +494,13 @@ class ###Component###ModelImport extends JModelLegacy
// Get a db connection. // Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// set some defaults // set some defaults
$todayDate = JFactory::getDate()->toSql(); $todayDate = JFactory::getDate()->toSql();
// get global action permissions // get global action permissions
$canDo = ###Component###Helper::getActions($table); $canDo = ###Component###Helper::getActions($table);
$canEdit = $canDo->get('core.edit'); $canEdit = $canDo->get('core.edit');
$canState = $canDo->get('core.edit.state'); $canState = $canDo->get('core.edit.state');
$canCreate = $canDo->get('core.create'); $canCreate = $canDo->get('core.create');
$hasAlias = $this->getAliasesUsed($table); $hasAlias = $this->getAliasesUsed($table);
// prosses the data // prosses the data
foreach($data['array'] as $row) foreach($data['array'] as $row)
{ {
@ -522,11 +522,11 @@ class ###Component###ModelImport extends JModelLegacy
if($found && $canEdit) if($found && $canEdit)
{ {
// update item // update item
$id = $row[$id_key]; $id = $row[$id_key];
$version = $db->loadResult(); $version = $db->loadResult();
// reset all buckets // reset all buckets
$query = $db->getQuery(true); $query = $db->getQuery(true);
$fields = array(); $fields = array();
// Fields to update. // Fields to update.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -571,8 +571,8 @@ class ###Component###ModelImport extends JModelLegacy
} }
} }
// load the defaults // load the defaults
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id); $fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate); $fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
// Conditions for which records should be updated. // Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('id') . ' = ' . $id $db->quoteName('id') . ' = ' . $id
@ -587,9 +587,9 @@ class ###Component###ModelImport extends JModelLegacy
// insert item // insert item
$query = $db->getQuery(true); $query = $db->getQuery(true);
// reset all buckets // reset all buckets
$columns = array(); $columns = array();
$values = array(); $values = array();
$version = false; $version = false;
// Insert columns. Insert values. // Insert columns. Insert values.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -627,30 +627,30 @@ class ###Component###ModelImport extends JModelLegacy
// set to insert array // set to insert array
if(in_array($key, $data['target_headers']) && is_numeric($cell)) if(in_array($key, $data['target_headers']) && is_numeric($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $cell; $values[] = $cell;
} }
elseif(in_array($key, $data['target_headers']) && is_string($cell)) elseif(in_array($key, $data['target_headers']) && is_string($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $db->quote($cell); $values[] = $db->quote($cell);
} }
elseif(in_array($key, $data['target_headers']) && is_null($cell)) elseif(in_array($key, $data['target_headers']) && is_null($cell))
{ {
// if import data is null then set empty // if import data is null then set empty
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = "''"; $values[] = "''";
} }
} }
// load the defaults // load the defaults
$columns[] = 'created_by'; $columns[] = 'created_by';
$values[] = $db->quote($user->id); $values[] = $db->quote($user->id);
$columns[] = 'created'; $columns[] = 'created';
$values[] = $db->quote($todayDate); $values[] = $db->quote($todayDate);
if (!$version) if (!$version)
{ {
$columns[] = 'version'; $columns[] = 'version';
$values[] = 1; $values[] = 1;
} }
// Prepare the insert query. // Prepare the insert query.
$query $query

View File

@ -59,8 +59,8 @@ class ###Component###Model###View### extends JModelLegacy
/** /**
* Import Settings * Import Settings
*/ */
protected $getType = NULL; protected $getType = NULL;
protected $dataType = NULL; protected $dataType = NULL;
/** /**
* Method to auto-populate the model state. * Method to auto-populate the model state.
@ -92,8 +92,8 @@ class ###Component###Model###View### extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -120,9 +120,9 @@ class ###Component###Model###View### extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -153,8 +153,8 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -184,8 +184,8 @@ class ###Component###Model###View### extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -198,8 +198,8 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -238,7 +238,7 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -251,15 +251,15 @@ class ###Component###Model###View### extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -277,8 +277,8 @@ class ###Component###Model###View### extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))

View File

@ -37,16 +37,16 @@ jimport('joomla.application.component.modellist');
*/ */
class ###Component###Model###SViews### extends JModelList class ###Component###Model###SViews### extends JModelList
{ {
/** /**
* Model user data. * Model user data.
* *
* @var strings * @var strings
*/ */
protected $user; protected $user;
protected $userId; protected $userId;
protected $guest; protected $guest;
protected $groups; protected $groups;
protected $levels; protected $levels;
protected $app; protected $app;
protected $input; protected $input;
protected $uikitComp; protected $uikitComp;
@ -58,16 +58,16 @@ class ###Component###Model###SViews### extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY### $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
} }
/** /**
@ -77,16 +77,16 @@ class ###Component###Model###SViews### extends JModelList
*/ */
public function getItems() public function getItems()
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// check if this user has permission to access items // check if this user has permission to access items
if (!$user->authorise('###sviews###.access', 'com_###component###')) if (!$user->authorise('###sviews###.access', 'com_###component###'))
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error'); $app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct (TODO for now we go to default view) // redirect away if not a correct (TODO for now we go to default view)
$app->redirect('index.php?option=com_###component###'); $app->redirect('index.php?option=com_###component###');
return false; return false;
}###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### }###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS###
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();

View File

@ -59,15 +59,15 @@ class ###Component###Model###SViews### extends JModelList
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; ###SITE_GET_LIST_QUERY### $this->initSet = true; ###SITE_GET_LIST_QUERY###
} }
/** /**

View File

@ -40,24 +40,24 @@ class ###Component###View###SView### extends JViewLegacy
// Overwriting JView display method // Overwriting JView display method
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_###component###'); $this->params = JComponentHelper::getParams('com_###component###');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
/** /**
* Prepares the document * Prepares the document
*/ */
protected function setDocument() protected function setDocument()
{###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');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sview###.css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
} }
/** /**
* Setting the toolbar * Setting the toolbar
@ -78,26 +78,26 @@ class ###Component###View###SView### extends JViewLegacy
} }
// add title to the page // add title to the page
JToolbarHelper::title($title,'###ICOMOON###'); JToolbarHelper::title($title,'###ICOMOON###');
// add the back button // add the back button
// JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); // JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
// add cpanel button // add cpanel button
JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###sviews###'); $help_url = ###Component###Helper::getHelpUrl('###sviews###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
}###CUSTOM_ADMIN_GET_MODULE### }###CUSTOM_ADMIN_GET_MODULE###
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -106,7 +106,7 @@ class ###Component###View###SView### extends JViewLegacy
*/ */
public function escape($var) public function escape($var)
{ {
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset); return ###Component###Helper::htmlEscape($var, $this->_charset);
} }
} }

View File

@ -44,27 +44,27 @@ class ###Component###View###View### extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ###Component###Helper::getActions('###view###',$this->item); $this->canDo = ###Component###Helper::getActions('###view###',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
} }
elseif($this->ref) elseif($this->ref)
{ {
// return to the list view that refered to this item // return to the list view that refered to this item
$this->referral = '&ref='.(string)$this->ref; $this->referral = '&ref='.(string)$this->ref;
}###LINKEDVIEWITEMS### }###LINKEDVIEWITEMS###
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();
@ -91,7 +91,7 @@ class ###Component###View###View### extends JViewLegacy
###ADDTOOLBAR### ###ADDTOOLBAR###
} }
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -105,7 +105,7 @@ class ###Component###View###View### extends JViewLegacy
// use the helper htmlEscape method instead and shorten the string // use the helper htmlEscape method instead and shorten the string
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
} }
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset); return ###Component###Helper::htmlEscape($var, $this->_charset);
} }
@ -117,11 +117,14 @@ class ###Component###View###View### extends JViewLegacy
protected function setDocument() protected function setDocument()
{ {
$isNew = ($this->item->id < 1); $isNew = ($this->item->id < 1);
$document = JFactory::getDocument(); if (!isset($this->document))
$document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); {
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS### $this->document = JFactory::getDocument();
$document->addScript(JURI::root() . $this->script); }
$document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP### $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
$this->document->addScript(JURI::root() . $this->script);
$this->document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');
} }
} }

View File

@ -48,7 +48,7 @@ class ###Component###View###View### extends JViewLegacy
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ###Component###Helper::getActions('###view###',$this->item); $this->canDo = ###Component###Helper::getActions('###view###',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
@ -56,15 +56,15 @@ class ###Component###View###View### extends JViewLegacy
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
} }
elseif($this->ref) elseif($this->ref)
{ {
// return to the list view that refered to this item // return to the list view that refered to this item
$this->referral = '&ref='.(string)$this->ref; $this->referral = '&ref='.(string)$this->ref;
}###LINKEDVIEWITEMS### }###LINKEDVIEWITEMS###
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();
@ -95,7 +95,7 @@ class ###Component###View###View### extends JViewLegacy
$this->toolbar = JToolbar::getInstance(); $this->toolbar = JToolbar::getInstance();
} }
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -109,7 +109,7 @@ class ###Component###View###View### extends JViewLegacy
// use the helper htmlEscape method instead and shorten the string // use the helper htmlEscape method instead and shorten the string
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
} }
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset); return ###Component###Helper::htmlEscape($var, $this->_charset);
} }
@ -121,16 +121,19 @@ class ###Component###View###View### extends JViewLegacy
protected function setDocument() protected function setDocument()
{ {
$isNew = ($this->item->id < 1); $isNew = ($this->item->id < 1);
$document = JFactory::getDocument(); if (!isset($this->document))
$document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); {
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
// we need this to fix the form display // we need this to fix the form display
$document->addStyleSheet(JURI::root()."administrator/templates/isis/css/template.css"); $this->document->addStyleSheet(JURI::root()."administrator/templates/isis/css/template.css");
$document->addScript(JURI::root()."administrator/templates/isis/js/template.js"); $this->document->addScript(JURI::root()."administrator/templates/isis/js/template.js");
// the default style of this view // the default style of this view
$document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS### $this->document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
// default javascript of this view // default javascript of this view
$document->addScript(JURI::root().$this->script); $this->document->addScript(JURI::root().$this->script);
$document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP### $this->document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');
} }
} }

View File

@ -104,10 +104,10 @@ class ###Component###ViewImport extends JViewLegacy
} }
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('import'); $help_url = ###Component###Helper::getHelpUrl('import');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
} }
} }

View File

@ -52,10 +52,10 @@ class ###Component###View###View### extends JViewLegacy
} }
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###view###'); $help_url = ###Component###Helper::getHelpUrl('###view###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
} }
} }

View File

@ -50,26 +50,26 @@ class ###Component###View###Views### extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
{ {
$this->addToolbar(); $this->addToolbar();
$this->sidebar = JHtmlSidebar::render(); $this->sidebar = JHtmlSidebar::render();
// load the batch html // load the batch html
if ($this->canCreate && $this->canEdit && $this->canState) if ($this->canCreate && $this->canEdit && $this->canState)
{ {
$this->batchDisplay = JHtmlBatch_::render(); $this->batchDisplay = JHtmlBatch_::render();
} }
} }
// Check for errors. // Check for errors.
@ -92,86 +92,86 @@ class ###Component###View###Views### extends JViewLegacy
{ {
JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate) if ($this->canCreate)
{ {
JToolBarHelper::addNew('###view###.add'); JToolBarHelper::addNew('###view###.add');
} }
// Only load if there are items // Only load if there are items
if (###Component###Helper::checkArray($this->items)) if (###Component###Helper::checkArray($this->items))
{ {
if ($this->canEdit) if ($this->canEdit)
{ {
JToolBarHelper::editList('###view###.edit'); JToolBarHelper::editList('###view###.edit');
} }
if ($this->canState) if ($this->canState)
{ {
JToolBarHelper::publishList('###views###.publish'); JToolBarHelper::publishList('###views###.publish');
JToolBarHelper::unpublishList('###views###.unpublish'); JToolBarHelper::unpublishList('###views###.unpublish');
JToolBarHelper::archiveList('###views###.archive'); JToolBarHelper::archiveList('###views###.archive');
if ($this->canDo->get('core.admin')) if ($this->canDo->get('core.admin'))
{ {
JToolBarHelper::checkin('###views###.checkin'); JToolBarHelper::checkin('###views###.checkin');
} }
} }
// Add a batch button // Add a batch button
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{ {
// Get the toolbar object instance // Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar'); $bar = JToolBar::getInstance('toolbar');
// set the batch button name // set the batch button name
$title = JText::_('JTOOLBAR_BATCH'); $title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button // Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch'); $layout = new JLayoutFile('joomla.toolbar.batch');
// add the button to the page // add the button to the page
$dhtml = $layout->render(array('title' => $title)); $dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch'); $bar->appendButton('Custom', $dhtml, 'batch');
}###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST### }###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST###
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{ {
JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
} }
elseif ($this->canState && $this->canDelete) elseif ($this->canState && $this->canDelete)
{ {
JToolbarHelper::trash('###views###.trash'); JToolbarHelper::trash('###views###.trash');
}###EXPORTBUTTON### }###EXPORTBUTTON###
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON### }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON###
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###views###'); $help_url = ###Component###Helper::getHelpUrl('###views###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
if ($this->canState) if ($this->canState)
{ {
JHtmlSidebar::addFilter( JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'), JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published', 'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
); );
// only load if batch allowed // only load if batch allowed
if ($this->canBatch) if ($this->canBatch)
{ {
JHtmlBatch_::addListSelection( JHtmlBatch_::addListSelection(
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'), JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'),
'batch[published]', 'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
); );
} }
} }
JHtmlSidebar::addFilter( JHtmlSidebar::addFilter(
@ -183,11 +183,11 @@ class ###Component###View###Views### extends JViewLegacy
if ($this->canBatch && $this->canCreate && $this->canEdit) if ($this->canBatch && $this->canCreate && $this->canEdit)
{ {
JHtmlBatch_::addListSelection( JHtmlBatch_::addListSelection(
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'), JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'),
'batch[access]', 'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
); );
} ###CATEGORYFILTER### ###OTHERFILTERS### }###CATEGORYFILTER### ###OTHERFILTERS###
} }
/** /**
@ -197,12 +197,15 @@ class ###Component###View###Views### extends JViewLegacy
*/ */
protected function setDocument() protected function setDocument()
{ {
$document = JFactory::getDocument(); if (!isset($this->document))
$document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###')); {
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css"); $this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css");
} }
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -213,10 +216,10 @@ class ###Component###View###Views### extends JViewLegacy
{ {
if(strlen($var) > 50) if(strlen($var) > 50)
{ {
// use the helper htmlEscape method instead and shorten the string // use the helper htmlEscape method instead and shorten the string
return ###Component###Helper::htmlEscape($var, $this->_charset, true); return ###Component###Helper::htmlEscape($var, $this->_charset, true);
} }
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset); return ###Component###Helper::htmlEscape($var, $this->_charset);
} }
@ -228,5 +231,5 @@ class ###Component###View###Views### extends JViewLegacy
protected function getSortFields() protected function getSortFields()
{ {
###SORTFIELDS### ###SORTFIELDS###
} ###FILTERFUNCTIONS### }###FILTERFUNCTIONS###
} }

View File

@ -40,24 +40,24 @@ class ###Component###View###SViews### extends JViewLegacy
// Overwriting JView display method // Overwriting JView display method
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_###component###'); $this->params = JComponentHelper::getParams('com_###component###');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
/** /**
* Prepares the document * Prepares the document
*/ */
protected function setDocument() protected function setDocument()
{###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');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sviews###.css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
} }
/** /**
* Setting the toolbar * Setting the toolbar
@ -65,29 +65,29 @@ class ###Component###View###SViews### extends JViewLegacy
protected function addToolBar() protected function addToolBar()
{ {
// hide the main menu // hide the main menu
$this->app->input->set('hidemainmenu', true); $this->app->input->set('hidemainmenu', true);
// add title to the page // add title to the page
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###'); JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');
// add the back button // add the back button
// JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); // JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
// add cpanel button // add cpanel button
JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###sviews###'); $help_url = ###Component###Helper::getHelpUrl('###sviews###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
}###CUSTOM_ADMIN_GET_MODULE### }###CUSTOM_ADMIN_GET_MODULE###
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -96,7 +96,7 @@ class ###Component###View###SViews### extends JViewLegacy
*/ */
public function escape($var) public function escape($var)
{ {
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset); return ###Component###Helper::htmlEscape($var, $this->_charset);
} }
} }

View File

@ -48,14 +48,14 @@ class ###Component###View###SViews### extends JViewLegacy
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
}###SITE_EXTRA_DIPLAY_METHODS### }###SITE_EXTRA_DIPLAY_METHODS###
/** /**
* Prepares the document * Prepares the document
*/ */
protected function _prepareDocument() protected function _prepareDocument()
{###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');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS### $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS###
} }
/** /**
* Setting the toolbar * Setting the toolbar
@ -75,7 +75,7 @@ class ###Component###View###SViews### extends JViewLegacy
$this->toolbar = JToolbar::getInstance(); $this->toolbar = JToolbar::getInstance();
}###SITE_GET_MODULE### }###SITE_GET_MODULE###
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -84,7 +84,7 @@ class ###Component###View###SViews### extends JViewLegacy
*/ */
public function escape($var, $sorten = false, $length = 40) public function escape($var, $sorten = false, $length = 40)
{ {
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
} }
} }

View File

@ -48,14 +48,14 @@ class ###Component###View###SView### extends JViewLegacy
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
}###SITE_EXTRA_DIPLAY_METHODS### }###SITE_EXTRA_DIPLAY_METHODS###
/** /**
* Prepares the document * Prepares the document
*/ */
protected function _prepareDocument() protected function _prepareDocument()
{###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');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS### $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS###
} }
/** /**
* Setting the toolbar * Setting the toolbar
@ -75,7 +75,7 @@ class ###Component###View###SView### extends JViewLegacy
$this->toolbar = JToolbar::getInstance(); $this->toolbar = JToolbar::getInstance();
}###SITE_GET_MODULE### }###SITE_GET_MODULE###
/** /**
* Escapes a value for output in a view script. * Escapes a value for output in a view script.
* *
* @param mixed $var The output to escape. * @param mixed $var The output to escape.
@ -84,7 +84,7 @@ class ###Component###View###SView### extends JViewLegacy
*/ */
public function escape($var, $sorten = false, $length = 40) public function escape($var, $sorten = false, $length = 40)
{ {
// use the helper htmlEscape method instead. // use the helper htmlEscape method instead.
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
###BOM###
/* JS Document */
###ADMINJS###

View File

@ -0,0 +1,4 @@
###BOM###
/* JS Document */
###CUSTOM_ADMIN_JAVASCRIPT_FILE###

View File

@ -0,0 +1,4 @@
###BOM###
/* JS Document */
###SITE_JAVASCRIPT_FILE###

View File

@ -47,44 +47,78 @@
/> />
<field type="spacer" name="spacerHistory" hr="true" /> <field type="spacer" name="spacerHistory" hr="true" />
<!-- Minify Field. Type: Radio. (joomla) --> <!-- Minify Field. Type: Radio. (joomla) -->
<field <field type="radio"
type="radio" name="minify"
name="minify" label="COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL"
label="COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL" description="COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION"
description="COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION" class="btn-group btn-group-yesno"
class="btn-group btn-group-yesno" default="0">
default="0"> <!-- Option Set.-->
<!-- Option Set. --> <option value="1">COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="1"> <option value="0">COM_COMPONENTBUILDER_CONFIG_NO</option>
COM_COMPONENTBUILDER_CONFIG_YES</option> </field>
<option value="0"> <!-- Percentagelanguageadd Field. Type: Number. (joomla) -->
COM_COMPONENTBUILDER_CONFIG_NO</option> <field type="number"
</field> name="percentagelanguageadd"
<!-- Percentagelanguageadd Field. Type: Number. (joomla) --> label="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_LABEL"
<field default="50"
type="number" description="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION"
name="percentagelanguageadd" class="text_area"
label="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_LABEL" required="true"
default="50" min="10"
description="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION" max="100"
class="text_area" step="10" />
required="true" <!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla) -->
min="10" <field type="spacer"
max="100" name="spacer_hr_a"
step="10" hr="true"
/> class="spacer_hr_a" />
<!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla) --> <!-- Api Field. Type: User. (joomla) -->
<field type="spacer" name="spacer_hr_a" hr="true" class="spacer_hr_a" /> <field type="user"
<!-- Api Field. Type: User. (joomla) --> name="api"
<field label="COM_COMPONENTBUILDER_CONFIG_API_LABEL"
type="user" description="COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION" />
name="api" <!-- Set_browser_storage Field. Type: Radio. (joomla) -->
label="COM_COMPONENTBUILDER_CONFIG_API_LABEL" <field type="radio"
description="COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION" name="set_browser_storage"
/> label="COM_COMPONENTBUILDER_CONFIG_SET_BROWSER_STORAGE_LABEL"
<!-- Spacer_hr_b Field. Type: Spacer. A None Database Field. (joomla) --> description="COM_COMPONENTBUILDER_CONFIG_SET_BROWSER_STORAGE_DESCRIPTION"
<field type="spacer" name="spacer_hr_b" hr="true" class="spacer_hr_b" /> class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set.-->
<option value="1">COM_COMPONENTBUILDER_CONFIG_ACTIVE</option>
<option value="0">COM_COMPONENTBUILDER_CONFIG_INACTIVE</option>
</field>
<!-- Storage_time_to_live Field. Type: List. (joomla) -->
<field type="list"
name="storage_time_to_live"
label="COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_DESCRIPTION"
class="list_class"
multiple="false"
default="global"
showon="set_browser_storage:1">
<!-- Option Set.-->
<option value="global">COM_COMPONENTBUILDER_CONFIG_EVERY_SESSION</option>
<option value="30">COM_COMPONENTBUILDER_CONFIG_EVERY_THIRTY_SECONDS</option>
<option value="60">COM_COMPONENTBUILDER_CONFIG_EVERY_MINUTE</option>
<option value="300">COM_COMPONENTBUILDER_CONFIG_EVERY_FIVE_MINUTES</option>
<option value="900">COM_COMPONENTBUILDER_CONFIG_EVERY_FIFTEEN_MINUTES</option>
<option value="1800">COM_COMPONENTBUILDER_CONFIG_EVERY_THIRTY_MINUTES</option>
<option value="3600">COM_COMPONENTBUILDER_CONFIG_EVERY_HOUR</option>
<option value="18000">COM_COMPONENTBUILDER_CONFIG_EVERY_FIVE_HOURS</option>
<option value="36000">COM_COMPONENTBUILDER_CONFIG_EVERY_TEN_HOURS</option>
<option value="86400">COM_COMPONENTBUILDER_CONFIG_EVERY_DAY</option>
<option value="604800">COM_COMPONENTBUILDER_CONFIG_EVERY_WEEK</option>
<option value="0">COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE</option>
</field>
<!-- Spacer_hr_b Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer"
name="spacer_hr_b"
hr="true"
class="spacer_hr_b" />
<field name="autorTitle" <field name="autorTitle"
type="spacer" type="spacer"
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR" label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"
@ -506,244 +540,246 @@
name="cronjob_custom_config" name="cronjob_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB"> label="COM_COMPONENTBUILDER_CONFIG_CRONJOB">
<!-- Backupcronjob_note Field. Type: Note. A None Database Field. (joomla) --> <!-- Backupcronjob_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="backupcronjob_note" label="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION" heading="h4" class="backupcronjob_note" /> <field type="note"
<!-- Cronjob_backup_folder_path Field. Type: Text. (joomla) --> name="backupcronjob_note"
<field label="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_LABEL"
type="text" description="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION"
name="cronjob_backup_folder_path" heading="h4"
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL" class="backupcronjob_note" />
size="70" <!-- Cronjob_backup_folder_path Field. Type: Text. (joomla) -->
maxlength="150" <field type="text"
description="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION" name="cronjob_backup_folder_path"
class="text_area" label="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL"
readonly="false" size="70"
disabled="false" maxlength="150"
required="false" description="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION"
filter="PATH" class="text_area"
message="Error! Please add some text here." readonly="false"
hint="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT" disabled="false"
/> required="false"
<!-- Backup_email Field. Type: Text. (joomla) --> filter="PATH"
<field message="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_MESSAGE"
type="text" hint="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT" />
name="backup_email" <!-- Backup_email Field. Type: Text. (joomla) -->
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_LABEL" <field type="text"
size="10" name="backup_email"
maxlength="50" label="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION" size="10"
class="text_area" maxlength="50"
filter="STRING" description="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION"
validate="email" class="text_area"
message="Error! Please add email address here." filter="STRING"
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_HINT" validate="email"
/> message="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_MESSAGE"
<!-- Package_name_plaeholders Field. Type: Note. A None Database Field. (joomla) --> hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_HINT" />
<field type="note" name="package_name_plaeholders" label="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_LABEL" description="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_DESCRIPTION" heading="h4" class="package_name_plaeholders" /> <!-- Package_name_plaeholders Field. Type: Note. A None Database Field. (joomla) -->
<!-- Backup_package_name Field. Type: Text. (joomla) --> <field type="note"
<field name="package_name_plaeholders"
type="text" label="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_LABEL"
name="backup_package_name" description="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_DESCRIPTION"
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_LABEL" heading="h4"
size="40" class="package_name_plaeholders" />
maxlength="150" <!-- Backup_package_name Field. Type: Text. (joomla) -->
default="JCB_Backup_[YEAR]_[MONTH]_[DAY]" <field type="text"
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_DESCRIPTION" name="backup_package_name"
class="text_area" label="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_LABEL"
readonly="false" size="40"
disabled="false" maxlength="150"
required="true" default="JCB_Backup_[YEAR]_[MONTH]_[DAY]"
filter="STRING" description="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_DESCRIPTION"
message="Error! Please add name here." class="text_area"
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_HINT" readonly="false"
/> disabled="false"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_MESSAGE"
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_HINT" />
</fieldset> </fieldset>
<fieldset <fieldset
name="folder_paths_custom_config" name="folder_paths_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_FOLDER_PATHS"> label="COM_COMPONENTBUILDER_CONFIG_FOLDER_PATHS">
<!-- Note_compiler_folder_path Field. Type: Note. A None Database Field. (joomla) --> <!-- Note_compiler_folder_path Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_compiler_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_COMPILER_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_COMPILER_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_compiler_folder_path" /> <field type="note"
<!-- Compiler_folder_path Field. Type: Text. (joomla) --> name="note_compiler_folder_path"
<field label="COM_COMPONENTBUILDER_CONFIG_NOTE_COMPILER_FOLDER_PATH_LABEL"
type="text" description="COM_COMPONENTBUILDER_CONFIG_NOTE_COMPILER_FOLDER_PATH_DESCRIPTION"
name="compiler_folder_path" heading="h4"
label="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_LABEL" class="alert alert-info note_compiler_folder_path" />
size="70" <!-- Compiler_folder_path Field. Type: Text. (joomla) -->
maxlength="150" <field type="text"
description="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_DESCRIPTION" name="compiler_folder_path"
class="text_area" label="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_LABEL"
readonly="false" size="70"
disabled="false" maxlength="150"
required="false" description="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_DESCRIPTION"
filter="PATH" class="text_area"
message="Error! Please add some text here." readonly="false"
hint="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_HINT" disabled="false"
/> required="false"
<!-- Note_custom_folder_path Field. Type: Note. A None Database Field. (joomla) --> filter="PATH"
<field type="note" name="note_custom_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_custom_folder_path" /> message="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_MESSAGE"
<!-- Custom_folder_path Field. Type: Text. (joomla) --> hint="COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_HINT" />
<field <!-- Note_custom_folder_path Field. Type: Note. A None Database Field. (joomla) -->
type="text" <field type="note"
name="custom_folder_path" name="note_custom_folder_path"
label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_LABEL" label="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_FOLDER_PATH_LABEL"
size="70" description="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_FOLDER_PATH_DESCRIPTION"
maxlength="150" heading="h4"
description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_DESCRIPTION" class="alert alert-info note_custom_folder_path" />
class="text_area" <!-- Custom_folder_path Field. Type: Text. (joomla) -->
readonly="false" <field type="text"
disabled="false" name="custom_folder_path"
required="false" label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_LABEL"
filter="PATH" size="70"
message="Error! Please add folder path here." maxlength="150"
hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_HINT" description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_DESCRIPTION"
/> class="text_area"
<!-- Note_backup_folder_path Field. Type: Note. A None Database Field. (joomla) --> readonly="false"
<field type="note" name="note_backup_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_BACKUP_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_BACKUP_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_backup_folder_path" /> disabled="false"
<!-- Backup_folder_path Field. Type: Text. (joomla) --> required="false"
<field filter="PATH"
type="text" message="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_MESSAGE"
name="backup_folder_path" hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_FOLDER_PATH_HINT" />
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_LABEL" <!-- Note_backup_folder_path Field. Type: Note. A None Database Field. (joomla) -->
size="70" <field type="note"
maxlength="150" name="note_backup_folder_path"
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_DESCRIPTION" label="COM_COMPONENTBUILDER_CONFIG_NOTE_BACKUP_FOLDER_PATH_LABEL"
class="text_area" description="COM_COMPONENTBUILDER_CONFIG_NOTE_BACKUP_FOLDER_PATH_DESCRIPTION"
readonly="false" heading="h4"
disabled="false" class="alert alert-info note_backup_folder_path" />
required="false" <!-- Backup_folder_path Field. Type: Text. (joomla) -->
filter="PATH" <field type="text"
message="Error! Please add folder path here." name="backup_folder_path"
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_HINT" label="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_LABEL"
/> size="70"
<!-- Note_git_folder_path Field. Type: Note. A None Database Field. (joomla) --> maxlength="150"
<field type="note" name="note_git_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_git_folder_path" /> description="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_DESCRIPTION"
<!-- Git_folder_path Field. Type: Text. (joomla) --> class="text_area"
<field readonly="false"
type="text" disabled="false"
name="git_folder_path" required="false"
label="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_LABEL" filter="PATH"
size="70" message="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_MESSAGE"
maxlength="150" hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_HINT" />
description="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_DESCRIPTION" <!-- Note_git_folder_path Field. Type: Note. A None Database Field. (joomla) -->
class="text_area" <field type="note"
readonly="false" name="note_git_folder_path"
disabled="false" label="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL"
required="false" description="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION"
filter="PATH" heading="h4"
message="Error! Please add folder path here." class="alert alert-info note_git_folder_path" />
hint="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT" <!-- Git_folder_path Field. Type: Text. (joomla) -->
/> <field type="text"
name="git_folder_path"
label="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_LABEL"
size="70"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="false"
filter="PATH"
message="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_MESSAGE"
hint="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT" />
</fieldset> </fieldset>
<fieldset <fieldset
name="company_custom_config" name="company_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_COMPANY"> label="COM_COMPONENTBUILDER_CONFIG_COMPANY">
<!-- Export_company Field. Type: Text. (joomla) --> <!-- Export_company Field. Type: Text. (joomla) -->
<field <field type="text"
type="text" name="export_company"
name="export_company" label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_LABEL"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_LABEL" size="40"
size="40" maxlength="150"
maxlength="150" description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_DESCRIPTION"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_DESCRIPTION" class="text_area"
class="text_area" readonly="false"
readonly="false" disabled="false"
disabled="false" required="true"
required="true" filter="STRING"
filter="STRING" message="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_MESSAGE"
message="Error! Please add company name here." hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_HINT" />
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_HINT" <!-- Export_owner Field. Type: Text. (joomla) -->
/> <field type="text"
<!-- Export_owner Field. Type: Text. (joomla) --> name="export_owner"
<field label="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_LABEL"
type="text" size="10"
name="export_owner" maxlength="120"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_LABEL" description="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_DESCRIPTION"
size="10" class="text_area"
maxlength="120" readonly="false"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_DESCRIPTION" disabled="false"
class="text_area" required="true"
readonly="false" filter="HTML"
disabled="false" message="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_MESSAGE"
required="true" hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_HINT" />
filter="HTML" <!-- Export_email Field. Type: Text. (joomla) -->
message="Error! Please add owner name here." <field type="text"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_HINT" name="export_email"
/> label="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_LABEL"
<!-- Export_email Field. Type: Text. (joomla) --> size="40"
<field maxlength="150"
type="text" description="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_DESCRIPTION"
name="export_email" class="text_area"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_LABEL" required="true"
size="40" filter="STRING"
maxlength="150" validate="email"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_DESCRIPTION" message="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_MESSAGE"
class="text_area" hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_HINT" />
required="true" <!-- Export_website Field. Type: Url. (joomla) -->
filter="STRING" <field type="url"
validate="email" name="export_website"
message="Error! Please email address here." label="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_LABEL"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_HINT" size="60"
/> maxlength="150"
<!-- Export_website Field. Type: Url. (joomla) --> description="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_DESCRIPTION"
<field class="text_area"
type="url" required="true"
name="export_website" filter="url"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_LABEL" validated="url"
size="60" message="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_MESSAGE"
maxlength="150" hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_HINT" />
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_DESCRIPTION" <!-- Export_license Field. Type: Textarea. (joomla) -->
class="text_area" <field type="textarea"
required="true" name="export_license"
filter="url" label="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_LABEL"
validated="url" rows="7"
message="Error! Please add website here." cols="10"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_HINT" default="GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html"
/> description="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_DESCRIPTION"
<!-- Export_license Field. Type: Textarea. (joomla) --> class="text_area span12"
<field filter="HTML"
type="textarea" hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_HINT"
name="export_license" required="true" />
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_LABEL" <!-- Export_copyright Field. Type: Textarea. (joomla) -->
rows="7" <field type="textarea"
cols="10" name="export_copyright"
default="GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html" label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_DESCRIPTION" rows="7"
class="text_area span12" cols="10"
filter="HTML" default="Copyright (C) 2015. All Rights Reserved"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_HINT" description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_DESCRIPTION"
required="true" class="text_area span12"
/> filter="HTML"
<!-- Export_copyright Field. Type: Textarea. (joomla) --> hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_HINT"
<field required="true" />
type="textarea" <!-- Export_buy_link Field. Type: Url. (joomla) -->
name="export_copyright" <field type="url"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_LABEL" name="export_buy_link"
rows="7" label="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_LABEL"
cols="10" size="60"
default="Copyright (C) 2015. All Rights Reserved" maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_DESCRIPTION" description="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_DESCRIPTION"
class="text_area span12" class="text_area"
filter="HTML" required="false"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_HINT" filter="url"
required="true" validated="url"
/> message="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_MESSAGE"
<!-- Export_buy_link Field. Type: Url. (joomla) --> hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_HINT" />
<field
type="url"
name="export_buy_link"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_DESCRIPTION"
class="text_area"
required="false"
filter="url"
validated="url"
message="Error! Please add link here."
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_HINT"
/>
</fieldset> </fieldset>
<fieldset <fieldset
name="permissions" name="permissions"

View File

@ -39,7 +39,7 @@ class ComponentbuilderController extends JControllerLegacy
* *
* @return void * @return void
*/ */
function display($cachable = false, $urlparams = false) function display($cachable = false, $urlparams = false)
{ {
// set default view if not set // set default view if not set
$view = $this->input->getCmd('view', 'Componentbuilder'); $view = $this->input->getCmd('view', 'Componentbuilder');
@ -48,46 +48,46 @@ class ComponentbuilderController extends JControllerLegacy
$id = $this->input->getInt('id'); $id = $this->input->getInt('id');
// Check for edit form. // Check for edit form.
if(ComponentbuilderHelper::checkArray($data)) if(ComponentbuilderHelper::checkArray($data))
{ {
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id)) if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id))
{ {
// Somehow the person just went to the form - we don't allow that. // Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error'); $this->setMessage($this->getError(), 'error');
// check if item was opend from other then its own list view // check if item was opend from other then its own list view
$ref = $this->input->getCmd('ref', 0); $ref = $this->input->getCmd('ref', 0);
$refid = $this->input->getInt('refid', 0); $refid = $this->input->getInt('refid', 0);
// set redirect // set redirect
if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) if ($refid > 0 && ComponentbuilderHelper::checkString($ref))
{ {
// redirect to item of ref // redirect to item of ref
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
} }
elseif (ComponentbuilderHelper::checkString($ref)) elseif (ComponentbuilderHelper::checkString($ref))
{ {
// redirect to ref // redirect to ref
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false));
} }
else else
{ {
// normal redirect back to the list view // normal redirect back to the list view
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false));
} }
return false; return false;
} }
} }
return parent::display($cachable, $urlparams); return parent::display($cachable, $urlparams);
} }
protected function getViewRelation($view) protected function getViewRelation($view)
{ {
if (ComponentbuilderHelper::checkString($view)) if (ComponentbuilderHelper::checkString($view))
{ {
$views = array( $views = array(
'joomla_component' => 'joomla_components', 'joomla_component' => 'joomla_components',
'admin_view' => 'admin_views', 'admin_view' => 'admin_views',
'custom_admin_view' => 'custom_admin_views', 'custom_admin_view' => 'custom_admin_views',
@ -96,6 +96,7 @@ class ComponentbuilderController extends JControllerLegacy
'layout' => 'layouts', 'layout' => 'layouts',
'dynamic_get' => 'dynamic_gets', 'dynamic_get' => 'dynamic_gets',
'custom_code' => 'custom_codes', 'custom_code' => 'custom_codes',
'library' => 'libraries',
'snippet' => 'snippets', 'snippet' => 'snippets',
'field' => 'fields', 'field' => 'fields',
'fieldtype' => 'fieldtypes', 'fieldtype' => 'fieldtypes',
@ -113,19 +114,22 @@ class ComponentbuilderController extends JControllerLegacy
'component_custom_admin_menus' => 'components_custom_admin_menus', 'component_custom_admin_menus' => 'components_custom_admin_menus',
'component_config' => 'components_config', 'component_config' => 'components_config',
'component_dashboard' => 'components_dashboard', 'component_dashboard' => 'components_dashboard',
'component_files_folders' => 'components_files_folders' 'component_files_folders' => 'components_files_folders',
); 'snippet_type' => 'snippet_types',
// check if this is a list view 'library_config' => 'libraries_config',
if (in_array($view,$views)) 'library_files_folders_urls' => 'libraries_files_folders_urls'
{ );
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); // check if this is a list view
} if (in_array($view,$views))
// check if it is an edit view {
elseif (array_key_exists($view,$views)) return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
{ }
return array('edit' => true, 'view' => $view, 'views' => $views[$view]); // check if it is an edit view
} elseif (array_key_exists($view,$views))
} {
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
}
}
return false; return false;
} }
} }

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -52,6 +52,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('getButton', 'ajax'); $this->registerTask('getButton', 'ajax');
$this->registerTask('getButtonID', 'ajax'); $this->registerTask('getButtonID', 'ajax');
$this->registerTask('getAjaxDisplay', 'ajax'); $this->registerTask('getAjaxDisplay', 'ajax');
$this->registerTask('getSnippets', 'ajax');
$this->registerTask('templateDetails', 'ajax'); $this->registerTask('templateDetails', 'ajax');
$this->registerTask('getLayoutDetails', 'ajax'); $this->registerTask('getLayoutDetails', 'ajax');
$this->registerTask('dbTableColumns', 'ajax'); $this->registerTask('dbTableColumns', 'ajax');
@ -60,6 +61,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('checkFunctionName', 'ajax'); $this->registerTask('checkFunctionName', 'ajax');
$this->registerTask('usedin', 'ajax'); $this->registerTask('usedin', 'ajax');
$this->registerTask('snippetDetails', 'ajax'); $this->registerTask('snippetDetails', 'ajax');
$this->registerTask('setSnippetGithub', 'ajax');
$this->registerTask('fieldOptions', 'ajax'); $this->registerTask('fieldOptions', 'ajax');
} }
@ -71,10 +73,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token) if($token == $call_token)
{ {
$task = $this->getTask(); $task = $this->getTask();
switch($task) switch($task)
{ {
case 'isNew': case 'isNew':
try try
{ {
@ -456,6 +458,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
} }
break; break;
case 'getSnippets':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$librariesValue = $jinput->get('libraries', NULL, 'STRING');
if($librariesValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getSnippets($librariesValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'templateDetails': case 'templateDetails':
try try
{ {
@ -768,6 +808,45 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
} }
break; break;
case 'setSnippetGithub':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$pathValue = $jinput->get('path', NULL, 'STRING');
$statusValue = $jinput->get('status', NULL, 'WORD');
if($pathValue && $statusValue && $user->id != 0)
{
$result = $this->getModel('ajax')->setSnippetGithub($pathValue, $statusValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'fieldOptions': case 'fieldOptions':
try try
{ {
@ -808,14 +887,14 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
break; break;
} }
} }
else else
{ {
if($callback = $jinput->get('callback', null, 'CMD')) if($callback = $jinput->get('callback', null, 'CMD'))
{ {
echo $callback."(".json_encode(false).");"; echo $callback."(".json_encode(false).");";
} }
else else
{ {
echo "(".json_encode(false).");"; echo "(".json_encode(false).");";
} }
} }

View File

@ -105,6 +105,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
$message .= '<ul>'; $message .= '<ul>';
$message .= '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>'; $message .= '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>';
$message .= '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>'; $message .= '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>';
$message .= '<li>Total fields created: <b>'.$model->compiler->fieldCount.'</b></li>';
$message .= '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>'; $message .= '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>';
$message .= '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>'; $message .= '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>';
$message .= '</ul>'; $message .= '</ul>';

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -108,4 +108,13 @@ class ComponentbuilderControllerCustom_admin_views extends JControllerAdmin
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error');
return; return;
} }
public function getSnippets()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the import snippets custom admin view
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
} }

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -158,10 +158,10 @@ class ComponentbuilderControllerField extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -273,11 +273,11 @@ class ComponentbuilderControllerField extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -158,10 +158,10 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -273,11 +273,11 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerFtp extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerFtp extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -0,0 +1,108 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage get_snippets.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Get_snippets Controller
*/
class ComponentbuilderControllerGet_snippets extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_GET_SNIPPETS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Get_snippets', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
public function dashboard()
{
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false));
return;
}
public function openLibraries()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the libraries
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries', false));
return;
}
public function openSnippets()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the snippets
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false));
return;
}
public function openSiteViews()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the site views
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false));
return;
}
public function openCustomAdminViews()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the custom admin views
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false));
return;
}
public function openTemplates()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the templates
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates', false));
return;
}
public function openLayouts()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the layouts
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false));
return;
}
}

View File

@ -48,7 +48,8 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
// Check Token! // Check Token!
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($user->id != 0 && $token == $call_token){ if($user->id != 0 && $token == $call_token)
{
$task = $this->getTask(); $task = $this->getTask();
switch($task){ switch($task){
case 'getText': case 'getText':
@ -64,25 +65,25 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
$result = ''; $result = '';
} }
echo $result; echo $result;
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
catch(Exception $e) catch(Exception $e)
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
break; break;
} }
} }
else else
{ {
// stop execution gracefully // stop execution gracefully
jexit(); jexit();
} }
} }
protected function getHelpDocumentText($id) protected function getHelpDocumentText($id)
{ {
$db = JFactory::getDbo(); $db = JFactory::getDbo();
$query = $db->getQuery(true); $query = $db->getQuery(true);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -114,8 +114,8 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
// Check for request forgeries // Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user. // check if import is allowed for this user.
$model->user = JFactory::getUser(); $user = JFactory::getUser();
if ($model->user->authorise('joomla_component.import', 'com_componentbuilder') && $model->user->authorise('core.import', 'com_componentbuilder')) if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{ {
$session = JFactory::getSession(); $session = JFactory::getSession();
$session->set('backto_VDM_IMPORT', 'joomla_components'); $session->set('backto_VDM_IMPORT', 'joomla_components');

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerLayout extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerLayout extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -108,4 +108,13 @@ class ComponentbuilderControllerLayouts extends JControllerAdmin
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error');
return; return;
} }
public function getSnippets()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the import snippets custom admin view
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
} }

View File

@ -0,0 +1,57 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Libraries Controller
*/
class ComponentbuilderControllerLibraries extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LIBRARIES';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Library', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
public function getSnippets()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the import snippets custom admin view
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
}

View File

@ -0,0 +1,48 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries_config.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Libraries_config Controller
*/
class ComponentbuilderControllerLibraries_config extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LIBRARIES_CONFIG';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Library_config', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

View File

@ -0,0 +1,48 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage libraries_files_folders_urls.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Libraries_files_folders_urls Controller
*/
class ComponentbuilderControllerLibraries_files_folders_urls extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Library_files_folders_urls', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

View File

@ -0,0 +1,351 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Library Controller
*/
class ComponentbuilderControllerLibrary extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Libraries'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('library.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('library.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $recordId) && $user->authorise('library.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('library.edit', 'com_componentbuilder.library.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('library.edit.own', 'com_componentbuilder.library.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('library.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('library.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
// get the state object (Joomla\CMS\Object\CMSObject)
$state = $model->get('state');
// if we save2copy we need to also copy linked tables found!
if ($state->task === 'save2copy' && $state->{'library.new'})
{
// get new ID
$newID = $state->{'library.id'};
// get old ID
$oldID = $this->input->get('id', 0, 'INT');
// linked tables to update
$_tablesArray = array(
'library_config',
'library_files_folders_urls'
);
foreach($_tablesArray as $_updateTable)
{
// get the linked ID
if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, 'library', 'id'))
{
// copy fields to new linked table
ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('library' => $newID));
}
}
}
return;
}
}

View File

@ -0,0 +1,326 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library_config.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Library_config Controller
*/
class ComponentbuilderControllerLibrary_config extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Libraries_config'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('library_config.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('library_config.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $recordId) && $user->authorise('library_config.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('library_config.edit', 'com_componentbuilder.library_config.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('library_config.edit.own', 'com_componentbuilder.library_config.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('library_config.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('library_config.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library_config', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries_config' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

@ -0,0 +1,326 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage library_files_folders_urls.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Library_files_folders_urls Controller
*/
class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Libraries_files_folders_urls'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('library_files_folders_urls.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('library_files_folders_urls.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('library_files_folders_urls.edit', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('library_files_folders_urls.edit.own', 'com_componentbuilder.library_files_folders_urls.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('library_files_folders_urls.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('library_files_folders_urls.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library_files_folders_urls', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries_files_folders_urls' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerSite_view extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerSite_view extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -108,4 +108,13 @@ class ComponentbuilderControllerSite_views extends JControllerAdmin
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error');
return; return;
} }
public function getSnippets()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// redirect to the import snippets custom admin view
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
} }

View File

@ -159,10 +159,10 @@ class ComponentbuilderControllerSnippet extends JControllerForm
{ {
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid; $append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
} }
elseif ($ref) elseif ($ref)
{ {
$append .= '&ref='.(string)$ref; $append .= '&ref='.(string)$ref;
} }
if ($tmpl) if ($tmpl)
{ {
@ -274,11 +274,11 @@ class ComponentbuilderControllerSnippet extends JControllerForm
$this->ref = $this->input->get('ref', 0, 'word'); $this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int'); $this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid) if ($this->ref || $this->refid)
{ {
// to make sure the item is checkedin on redirect // to make sure the item is checkedin on redirect
$this->task = 'save'; $this->task = 'save';
} }
$saved = parent::save($key, $urlVar); $saved = parent::save($key, $urlVar);

View File

@ -0,0 +1,326 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage snippet_type.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Snippet_type Controller
*/
class ComponentbuilderControllerSnippet_type extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Snippet_types'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('snippet_type.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('snippet_type.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $recordId) && $user->authorise('snippet_type.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('snippet_type.edit', 'com_componentbuilder.snippet_type.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('snippet_type.edit.own', 'com_componentbuilder.snippet_type.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('snippet_type.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('snippet_type.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Snippet_type', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippet_types' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

@ -0,0 +1,48 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage snippet_types.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Snippet_types Controller
*/
class ComponentbuilderControllerSnippet_types extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_SNIPPET_TYPES';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Snippet_type', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

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