Compare commits

...

63 Commits

Author SHA1 Message Date
8501e37b3e updated some of the component import script, resolved gh-113 to improve assets rules setting for components 2017-08-23 21:38:28 +01:00
1c37f13820 fixed component import issue, to insure mysql dump data in admin-view gets imported correctly 2017-08-23 15:52:31 +01:00
e6b3c2391d fixed function button bug that loaded it to all views, instead of only the owner view 2017-08-22 23:44:53 +01:00
cfc1af2b69 added site-view switch to allow default public access if access is set on the site view as explained in gh-113 2017-08-22 23:17:19 +01:00
9c1ee3e88a updated the donation info 2017-08-21 02:24:30 +01:00
e3528344af Major upgrade, to initiate front-end development for JCB. Little steps at a time forward. 2017-08-20 22:18:16 +01:00
0ccc84e2ff fixed the getVars backward compatibility issue, Added replyto and replytoname to email helper, renamed the email helper class that builds the email table to setTableBody 2017-08-20 21:47:14 +01:00
e0730d3bf6 added JCB initial API frontend to run backups of JCB components, setup automated backup system with cronjob 2017-08-20 18:52:35 +01:00
ddeb02de74 version upgrade 2017-08-12 19:00:05 +01:00
e003be492c Fixed gh-108 to insure that all fields get added if multiple zeros are found. Improved the default value options in global config to allow for array of default values. Fixed typo forward slash. 2017-08-12 12:51:28 +01:00
fb7b5027c2 improved the answer for gh-106 to insure the correct form is submitted on compile 2017-08-05 12:28:24 +01:00
7a902d454a fixed gh-106 to insure the correct form is submitted on compile, also some other minor bug fixes 2017-08-05 12:10:08 +01:00
bd716ae7ef Stable Release 2017-07-24 04:28:27 +01:00
e074d3b5ce added Joomla to the header in the readme since it has become know as JCB 2017-07-21 00:38:35 +01:00
f1a054c0e7 Imporved the Adding of Custom Config Fields, added some shields.io icons to the JCB readme 2017-07-21 00:26:48 +01:00
e037d29935 version upgrade 2017-07-03 01:41:25 +01:00
b60803ef7b added timeago lib to repo for jQuery, and added dates to issue and release info on dash 2017-06-29 23:23:06 +01:00
aceda7bae2 Fixed a bug with the automated update sql that ensured that the sql for new fields gets added. 2017-06-29 22:03:53 +01:00
111aa4a3de donation info updated 2017-06-28 21:02:04 +01:00
9742991690 improved the dashboard of JCB to include releases and better item display of each issue and release 2017-06-28 11:05:31 +01:00
2c1903508c added the subform and custom and other fields to the demo 2017-06-18 11:47:10 +01:00
384c403ae4 Add new release with subform field now also available 2017-06-18 08:38:12 +01:00
6e0bcc0ae2 Resolves gh-96 by adding the feature to auto create the update SQL. Also fixes gh-100 Field Length Issue. 2017-06-16 13:38:06 +01:00
3ad9ae8b8f resolves gh-91 to insure that int and floats are not set as strings in SQL defaults 2017-06-05 21:18:32 +01:00
Dev
5e36ede2ac fixed gh-85 to insure parameter 2 is an array 2017-05-28 23:44:15 +02:00
cb355feaf4 fixed import of components selection 2017-05-20 09:36:26 +02:00
9b1f111251 fix gh-78 to ensure the field options get loaded in the repeatable conditions 2017-05-08 11:09:24 +03:00
4cead46ac4 Fixed gh-75 to insure the column names are loaded as before. Fix gh-76 by adding more checks to insure that the correct date is used in the getLastModifiedDate method. 2017-05-04 23:34:28 +01:00
25c632065a updated the readme 2017-04-26 17:30:09 +01:00
ea1edebc05 Resolves gh-71 bug, so that admin views that has no fields are still accessible. Fixed gh-72 to insure all components on Joomla version 3.7.0 works and looks correctly. Please just recompile your components for Joomla v3.7.0 2017-04-26 09:56:17 +01:00
498c75dfcf Next stable release with improvments and fixes 2017-04-08 22:58:53 +01:00
f39a877db2 fixed double // in file path when exporting a component and its images 2017-04-08 21:52:51 +01:00
7afbb131ce fixes gh-68 where the wrong name is used in searching for the alias, it must be the table name, and this is not always the same as the view. 2017-04-08 19:52:09 +01:00
6bba258fec Improved the import feature to insure that we don't have language conflicts with multiple strings for one language. 2017-04-08 14:44:41 +01:00
1cf259a54d Resolves gh-60 with complete implementation of the language manager/translator feature. Added a purge function the clear unused language strings from the database and unlike them from the related component during compilation. 2017-04-07 21:33:35 +01:00
d113d7b91b Added the new language feature to the export and import of Components, so that their related translations can also be linked to the exported package. 2017-04-06 22:40:22 +01:00
dev
2f90f9359c fixed typo 2017-04-06 09:51:46 +01:00
dev
b1d9b672ab Added the global switch to set the percentage a language should be translated before it is automatically added to the component during compilation. Force language to be added when the debug lines are set to be added. 2017-04-06 09:47:51 +01:00
dev
d9b2e51f8c Fix redirect during creation of new language from translation view. 2017-04-05 21:14:29 +01:00
dev
2caaa1a1e3 added the translation to the component view, also adding lang tags of ready translated languages 2017-04-05 17:26:17 +01:00
dev
1b3cb2bfdd fixed the search in translation view 2017-04-05 16:21:56 +01:00
dev
5a6ef33c5b removed button for now 2017-04-05 15:07:48 +01:00
dev
7eb5a2473c include fix for the a.* error 2017-04-05 14:49:11 +01:00
dev
34d14ed95d gh-60 language translation component added, basic implementation 2017-04-05 14:21:10 +01:00
d31b0b6c0c fixed gh-53 the database error call on a.*, very strange 2017-04-05 07:27:39 +01:00
dev
f3f91f492f added the UI for the new Language Manager gh-60 2017-04-03 11:58:41 +01:00
bd0febd92c Resolves gh-63 to prevent repeateble field from being created a second time. Resolves gh-62 to insure full encryption of JCB packages. 2017-04-01 15:59:54 +02:00
b294af2e7d Stable release of component mapped export and import feature 2017-03-31 23:39:20 +02:00
82fd08cf57 Resolves gh-59 the repeatable field id problem. Also improved the export and import to insure snippets and linked admin views are re-mapped on import of the component. Also fixed the target and match field conditions in admin views to re-map the ids correctly. 2017-03-31 23:28:16 +02:00
5dc3f97f15 Export any component completely mapped in JCB and import into another JCB with owner control 2017-03-31 10:18:33 +02:00
cca07258d6 Added owner and key control to export & import of components, also added buy and package link building to global options gh-53 2017-03-30 23:19:12 +02:00
f61bb46073 Resolves gh-53 with stable export & import of fully mapped components. Key export & import encryption and forced update switch, with error and waring messages has been added. 2017-03-28 16:57:59 +02:00
8b522f44d9 Further gh-53 implementation of the export and import of complete components as JCB packages. Fixes gh-56 2017-03-27 14:38:51 +02:00
63b1bac955 Expanded the export feature of gh-53 to bundle the data into package. 2017-03-21 00:07:14 +02:00
3c610acb31 Merge pull request #55 from ro-ot/staging
Development of the export feature of JCB components mapping.
2017-03-19 10:30:09 +02:00
dev
cfd9b33b30 added the custom code search and more to gh-53 2017-03-19 00:55:34 +02:00
dev
952d26f1f8 added the getData method of the component smart export feature 2017-03-18 22:17:15 +02:00
dev
b0ad2ddffc Added the basic code for controller and model for gh-53 2017-03-18 13:16:07 +02:00
7534aed01d Fixed #54 2017-03-18 04:53:27 +02:00
28198e9b9e Next stable release 2017-03-12 14:23:42 +02:00
dev
3953df845c impoved the request linking options, fixed few bugs in compiler (#52) 2017-03-08 06:49:54 +02:00
30e37dcfde Improved category integration, adapted the fields generator to allow one field to be used multiple times in the same view 2017-03-06 14:08:12 +02:00
bc9e5495d7 fixed #43 to insure fields are sorted in the correct order. Added the noticeboard to the compiler page, to insure all our notices gets viewed by all those who use the JCB 2017-03-03 23:53:18 +02:00
568 changed files with 27697 additions and 6227 deletions

View File

@ -1,14 +1,15 @@
# Component Builder (2.3.6)
# Joomla Component Builder (JCB)
[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases)
This is a [Joomla 3.x](http://www.joomla.org/) component.
![Component Builder image](https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/admin/assets/images/component-300.jpg "The Component Builder")
![Component Builder image](https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/admin/assets/images/vdm-component.jpg "The Component Builder")
The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, truly able to build extremely complex components in a fraction of the time.
Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.3.6) 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.5.1) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -70,16 +71,19 @@ Once installed upgrades are quick and easy via the default Joomla upgrade area.
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in JCB and import into another JCB.
+ This and much much more are all possible with this component builder!
# Get Access to Video Tutorials
> **You can purchase more demo content for Component Builder including access to training & help video tutorials:**
> **You can purchase more [demo content](http://vdm.bz/jcb-packages) for Component Builder including access to training & help video tutorials:**
+ Demo Component* see the build on [github](https://github.com/namibia/demo-joomla-3-component)
+ Sermon Distributor* see the build on [github](https://github.com/SermonDistributor/Joomla-3-Component)
+ Help View Integration*
+ Training & Help Videos* tutorials in the component included.
+ *Demo Component* see the build on [github](https://github.com/namibia/demo-joomla-3-component) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_demo.zip) _(free)_
+ *Advance Demo Component* get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_demoAdvanced.zip) _([buy key](http://vdm.bz/get-advance-demo-key))_
+ *Sermon Distributor* see the build on [github](https://github.com/SermonDistributor/Joomla-3-Component) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_sermondistributor.zip) _([buy key](http://vdm.bz/get-sermon-distributor-key))_
+ *Location Data* see the build on [github](https://github.com/vdm-io/Joomla-Location-Data) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_locationData.zip) _([buy key](http://vdm.bz/get-location-data-key))_
+ *Help View Integration*
+ *Training & Help Videos* tutorials in the component included.
[**GET ACCESS NOW!**](http://vdm.bz/component-builder)
@ -104,13 +108,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 1st March, 2017
+ *Version*: 2.3.6
+ *Last Build*: 23rd August, 2017
+ *Version*: 2.5.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **92671**
+ *File count*: **596**
+ *Folder count*: **105**
+ *Line count*: **111668**
+ *File count*: **664**
+ *Folder count*: **117**
> 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)
@ -118,5 +122,6 @@ Component Builder is mapped as a component in itself on my local development env
## Donations
Come on buy me a coffee :)
* PayPal: pay@vdm.io
* Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa
* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823

View File

@ -1,14 +1,15 @@
# Component Builder (2.3.6)
# Joomla Component Builder (JCB)
[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases)
This is a [Joomla 3.x](http://www.joomla.org/) component.
![Component Builder image](https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/admin/assets/images/component-300.jpg "The Component Builder")
![Component Builder image](https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/admin/assets/images/vdm-component.jpg "The Component Builder")
The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, truly able to build extremely complex components in a fraction of the time.
Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.3.6) 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.5.1) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -70,16 +71,19 @@ Once installed upgrades are quick and easy via the default Joomla upgrade area.
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ Export any component completely mapped in JCB and import into another JCB.
+ This and much much more are all possible with this component builder!
# Get Access to Video Tutorials
> **You can purchase more demo content for Component Builder including access to training & help video tutorials:**
> **You can purchase more [demo content](http://vdm.bz/jcb-packages) for Component Builder including access to training & help video tutorials:**
+ Demo Component* see the build on [github](https://github.com/namibia/demo-joomla-3-component)
+ Sermon Distributor* see the build on [github](https://github.com/SermonDistributor/Joomla-3-Component)
+ Help View Integration*
+ Training & Help Videos* tutorials in the component included.
+ *Demo Component* see the build on [github](https://github.com/namibia/demo-joomla-3-component) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_demo.zip) _(free)_
+ *Advance Demo Component* get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_demoAdvanced.zip) _([buy key](http://vdm.bz/get-advance-demo-key))_
+ *Sermon Distributor* see the build on [github](https://github.com/SermonDistributor/Joomla-3-Component) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_sermondistributor.zip) _([buy key](http://vdm.bz/get-sermon-distributor-key))_
+ *Location Data* see the build on [github](https://github.com/vdm-io/Joomla-Location-Data) or get the [JCB Package](https://github.com/vdm-io/JCB-Packages/raw/master/JCB_locationData.zip) _([buy key](http://vdm.bz/get-location-data-key))_
+ *Help View Integration*
+ *Training & Help Videos* tutorials in the component included.
[**GET ACCESS NOW!**](http://vdm.bz/component-builder)
@ -104,13 +108,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 1st March, 2017
+ *Version*: 2.3.6
+ *Last Build*: 23rd August, 2017
+ *Version*: 2.5.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **92671**
+ *File count*: **596**
+ *Folder count*: **105**
+ *Line count*: **111668**
+ *File count*: **664**
+ *Folder count*: **117**
> 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)
@ -118,5 +122,6 @@ Component Builder is mapped as a component in itself on my local development env
## Donations
Come on buy me a coffee :)
* PayPal: pay@vdm.io
* Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa
* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823

View File

@ -101,6 +101,9 @@
<action name="help_document.export" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT_DESC" />
<action name="help_document.import" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT_DESC" />
<action name="help_document.submenu" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU_DESC" />
<action name="joomla_component.backup" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS_DESC" />
<action name="joomla_component.export_components" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_COMPONENTS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_COMPONENTS_BUTTON_ACCESS_DESC" />
<action name="joomla_component.import_components" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_COMPONENTS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_COMPONENTS_BUTTON_ACCESS_DESC" />
<action name="joomla_component.access" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS_DESC" />
<action name="joomla_component.batch" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE_DESC" />
<action name="joomla_component.dashboard_add" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC" />
@ -111,6 +114,29 @@
<action name="joomla_component.export" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT_DESC" />
<action name="joomla_component.import" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT_DESC" />
<action name="joomla_component.submenu" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC" />
<action name="language_translation.access" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS_DESC" />
<action name="language_translation.batch" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE_DESC" />
<action name="language_translation.create" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC" />
<action name="language_translation.dashboard_list" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST_DESC" />
<action name="language_translation.delete" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC" />
<action name="language_translation.edit" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_DESC" />
<action name="language_translation.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN_DESC" />
<action name="language_translation.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE_DESC" />
<action name="language_translation.version" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION_DESC" />
<action name="language_translation.export" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT_DESC" />
<action name="language_translation.import" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT_DESC" />
<action name="language_translation.submenu" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC" />
<action name="language.access" title="COM_COMPONENTBUILDER_LANGUAGES_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGES_ACCESS_DESC" />
<action name="language.batch" title="COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE" description="COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE_DESC" />
<action name="language.create" title="COM_COMPONENTBUILDER_LANGUAGES_CREATE" description="COM_COMPONENTBUILDER_LANGUAGES_CREATE_DESC" />
<action name="language.delete" title="COM_COMPONENTBUILDER_LANGUAGES_DELETE" description="COM_COMPONENTBUILDER_LANGUAGES_DELETE_DESC" />
<action name="language.edit" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_DESC" />
<action name="language.edit.own" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN_DESC" />
<action name="language.edit.state" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE_DESC" />
<action name="language.version" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION_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.submenu" title="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_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.dashboard_add" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC" />
@ -241,6 +267,24 @@
<action name="fieldtype.access" title="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC" />
<action name="fieldtype.version" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION_DESC" />
</section>
<section name="language_translation">
<action name="language_translation.edit" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_DESC" />
<action name="language_translation.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN_DESC" />
<action name="language_translation.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE_DESC" />
<action name="language_translation.create" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC" />
<action name="language_translation.delete" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC" />
<action name="language_translation.access" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS_DESC" />
<action name="language_translation.version" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION_DESC" />
</section>
<section name="language">
<action name="language.edit" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_DESC" />
<action name="language.edit.own" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN_DESC" />
<action name="language.edit.state" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE_DESC" />
<action name="language.create" title="COM_COMPONENTBUILDER_LANGUAGES_CREATE" description="COM_COMPONENTBUILDER_LANGUAGES_CREATE_DESC" />
<action name="language.delete" title="COM_COMPONENTBUILDER_LANGUAGES_DELETE" description="COM_COMPONENTBUILDER_LANGUAGES_DELETE_DESC" />
<action name="language.access" title="COM_COMPONENTBUILDER_LANGUAGES_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGES_ACCESS_DESC" />
<action name="language.version" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION_DESC" />
</section>
<section name="help_document">
<action name="help_document.edit" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_DESC" />
<action name="help_document.edit.own" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_OWN" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_OWN_DESC" />

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 99 of this MVC
@build 1st March, 2017
@version @update number 111 of this MVC
@build 17th July, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 99 of this MVC
@build 1st March, 2017
@version @update number 111 of this MVC
@build 17th July, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 26 of this MVC
@build 28th February, 2017
@version @update number 53 of this MVC
@build 5th August, 2017
@created 1st February, 2017
@package Component Builder
@subpackage compiler.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 1st March, 2017
@build 17th July, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 1st March, 2017
@build 17th July, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 26th April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 26th April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 15th January, 2017
@version @update number 84 of this MVC
@build 4th May, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_get.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 15th January, 2017
@version @update number 84 of this MVC
@build 4th May, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_gets.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 37 of this MVC
@build 3rd February, 2017
@version @update number 38 of this MVC
@build 28th May, 2017
@created 30th April, 2015
@package Component Builder
@subpackage field.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 37 of this MVC
@build 3rd February, 2017
@version @update number 38 of this MVC
@build 28th May, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 12 of this MVC
@build 20th October, 2016
@version @update number 13 of this MVC
@build 13th June, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 12 of this MVC
@build 20th October, 2016
@version @update number 13 of this MVC
@build 13th June, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 6 of this MVC
@build 17th October, 2016
@build 18th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_document.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 6 of this MVC
@build 17th October, 2016
@build 18th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_documents.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 96 of this MVC
@build 17th February, 2017
@version @update number 359 of this MVC
@build 23rd August, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 96 of this MVC
@build 17th February, 2017
@version @update number 359 of this MVC
@build 23rd August, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_components.css

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 3rd April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language.css
@author Llewellyn van der Merwe <http://vdm.bz/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 @update number 39 of this MVC
@build 7th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translation.css
@author Llewellyn van der Merwe <http://vdm.bz/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 @update number 39 of this MVC
@build 7th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translations.css
@author Llewellyn van der Merwe <http://vdm.bz/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 @update number 3 of this MVC
@build 3rd April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage languages.css
@author Llewellyn van der Merwe <http://vdm.bz/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

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 67 of this MVC
@build 22nd February, 2017
@version @update number 77 of this MVC
@build 30th May, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layout.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 67 of this MVC
@build 22nd February, 2017
@version @update number 77 of this MVC
@build 30th May, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layouts.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 1st March, 2017
@version @update number 51 of this MVC
@build 17th July, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 1st March, 2017
@version @update number 51 of this MVC
@build 17th July, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_views.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 22nd February, 2017
@build 1st April, 2017
@created 26th May, 2015
@package Component Builder
@subpackage template.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 22nd February, 2017
@build 1st April, 2017
@created 26th May, 2015
@package Component Builder
@subpackage templates.css

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -52,7 +52,10 @@ class ###Component###View###Component### extends JViewLegacy
// Assign data to the view
$this->icons = $this->get('Icons');
$this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA###
// get the manifest details of the component
$this->manifest = ###Component###Helper::manifest();
// Set the toolbar
$this->addToolBar();
@ -87,15 +90,19 @@ class ###Component###View###Component### extends JViewLegacy
/**
* Method to set up the document properties
*
*
* @return void
*/
protected function setDocument()
{
$document = JFactory::getDocument();
// add dashboard style sheets
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/dashboard.css");
// set page title
$document->setTitle(JText::_('COM_###COMPONENT###_DASHBOARD'));
// add manifest to page JavaScript
$document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
}
}

View File

@ -146,13 +146,25 @@ abstract class ###Component###Helper
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
$query->from($db->quoteName('#__'.$main.'_'.$table));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
$db->setQuery($query);
$db->execute();
@ -435,12 +447,20 @@ abstract class ###Component###Helper
**/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = '###component###')
{
// load some joomla helpers
JLoader::import('joomla.application.component.model');
// load the model file
JLoader::import( $name, $path . '/models' );
// return instance
return JModelLegacy::getInstance( $name, $component.'Model' );
JModelLegacy::addIncludePath( $path . '/models' );
// get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' );
// if model not found
if ($model == false)
{
// build class name
$class = $prefix.$name;
// initilize the model
new $class();
$model = JModelLegacy::getInstance($name, $prefix);
}
return $model;
}
/**
@ -647,10 +667,16 @@ abstract class ###Component###Helper
return false;
}
// typo sorry!
public static function sorten($string, $length = 40, $addTip = true)
{
return self::shorten($string, $length, $addTip);
}
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::checkString($string))
{
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
@ -670,7 +696,7 @@ abstract class ###Component###Helper
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::sorten($string, 400 , false);
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
@ -691,6 +717,21 @@ abstract class ###Component###Helper
// 0nly continue if we have a string
if (self::checkString($string))
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
@ -754,15 +795,15 @@ abstract class ###Component###Helper
return '';
}
public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40)
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{
if (self::checkString($var))
{
$filter = new JFilterInput();
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
if ($sorten)
if ($shorten)
{
return self::sorten($string,$length);
return self::shorten($string,$length);
}
return $string;
}

View File

@ -0,0 +1,35 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@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');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### Component Category Tree
*/
###CATEGORY_CLASS_TREES###

View File

@ -0,0 +1,50 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@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');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Component Category Tree
*/
class ###Component######Views###Categories extends JCategories
{
/**
* Class constructor
*
* @param array $options Array of options
*
*/
public function __construct($options = array())
{
$options['table'] = '#__###component###_###view###';
$options['extension'] = 'com_###component###.###views###';
parent::__construct($options);
}
}

View File

@ -114,6 +114,8 @@ abstract class ###Component###Email
$sendmail = $globalConf->get('sendmail');
$mailfrom = $globalConf->get('mailfrom');
$fromname = $globalConf->get('fromname');
$replyto = $globalConf->get('replyto');
$replytoname = $globalConf->get('replytoname');
}
else
{
@ -126,15 +128,15 @@ abstract class ###Component###Email
$sendmail = $conf->get('sendmail');
$mailfrom = $conf->get('mailfrom');
$fromname = $conf->get('fromname');
$mailreply = $conf->get('mailreply');
$replyname = $conf->get('replyname');
$replyto = $conf->get('replyto');
$replytoname = $conf->get('replytoname');
}
// set the global reply-to
if ($mailreply && $fromname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $mailreply, $replyname ) );
}
// set the global reply-to if found
if ($replyto && $replytoname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $replyto, $replytoname ) );
}
// Set global sender
@ -276,4 +278,74 @@ abstract class ###Component###Email
return $sendmail;
}
/**
* Set html text (in a row) and subject (as title) to a email table.
* do not use <p> instead use <br />
* in your html that you pass to this method
* since it is a table row it does not
* work well with paragraphs
*
* @return string on success
*
*/
public static function setTableBody($html, $subject)
{
$body = array();
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
$body[] = "<head>";
$body[] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$body[] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>";
$body[] = "<title>".$subject."</title>";
$body[] = "<style type=\"text/css\">";
$body[] = "#outlook a {padding:0;}";
$body[] = ".ExternalClass {width:100%;}";
$body[] = ".ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} ";
$body[] = "p {margin: 0; padding: 0; font-size: 0px; line-height: 0px;} ";
$body[] = "table td {border-collapse: collapse;}";
$body[] = "table {border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }";
$body[] = "img {display: block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;}";
$body[] = "a img {border: none;}";
$body[] = "a {text-decoration: none; color: #000001;}";
$body[] = "a.phone {text-decoration: none; color: #000001 !important; pointer-events: auto; cursor: default;}";
$body[] = "span {font-size: 13px; line-height: 17px; font-family: monospace; color: #000001;}";
$body[] = "</style>";
$body[] = "<!--[if gte mso 9]>";
$body[] = "<style>";
$body[] = "/* Target Outlook 2007 and 2010 */";
$body[] = "</style>";
$body[] = "<![endif]-->";
$body[] = "</head>";
$body[] = "<body style=\"width:100%; margin:0; padding:0; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;\">";
$body[] = "\n<!-- body wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin:0; padding:0; width:100%; line-height: 100% !important;\">";
$body[] = "<tr>";
$body[] = "<td valign=\"top\">";
$body[] = "<!-- edge wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"800\" >";
$body[] = "<tr>";
$body[] = "<td valign=\"top\">";
$body[] = "<!-- content wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"780\">";
$body[] = "<tr>";
$body[] = "<td valign=\"top\" style=\"vertical-align: top;\">";
$body[] = $html;
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / content wrapper -->";
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / edge wrapper -->";
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / page wrapper -->";
$body[] = "</body>";
$body[] = "</html>";
return implode("\n", $body);
}
}

View File

@ -118,12 +118,23 @@ abstract class ###Component###Helper
**/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = '###component###')
{
// load some joomla helpers
JLoader::import('joomla.application.component.model');
// full path
$fullPath = $path . '/models';
// load the model file
JLoader::import( $name, $path . '/models' );
// return instance
return JModelLegacy::getInstance( $name, $component.'Model' );
JModelLegacy::addIncludePath($fullPath);
// get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' );
// if model not found
if ($model == false)
{
require_once $fullPath.'/'.strtolower($name).'.php';
// build class name
$class = $prefix.$name;
// initialize the model
new $class();
$model = JModelLegacy::getInstance($name, $prefix);
}
return $model;
}
/**
@ -320,13 +331,25 @@ abstract class ###Component###Helper
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
$query->from($db->quoteName('#__'.$main.'_'.$table));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
$db->setQuery($query);
$db->execute();
@ -639,7 +662,13 @@ abstract class ###Component###Helper
return false;
}
// typo sorry!
public static function sorten($string, $length = 40, $addTip = true)
{
return self::shorten($string, $length, $addTip);
}
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::checkString($string))
{
@ -662,7 +691,7 @@ abstract class ###Component###Helper
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::sorten($string, 400 , false);
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
@ -683,6 +712,21 @@ abstract class ###Component###Helper
// 0nly continue if we have a string
if (self::checkString($string))
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
@ -746,15 +790,15 @@ abstract class ###Component###Helper
return '';
}
public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40)
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{
if (self::checkString($var))
{
$filter = new JFilterInput();
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
if ($sorten)
if ($shorten)
{
return self::sorten($string,$length);
return self::shorten($string,$length);
}
return $string;
}

View File

@ -34,6 +34,11 @@ defined('_JEXEC') or die('Restricted access');
*/
class ###Component###ModelImport extends JModelLegacy
{
// set uploading values
protected $use_streams = false;
protected $allow_unsafe = false;
protected $safeFileOptions = array();
/**
* @var object JTable object
*/
@ -75,10 +80,6 @@ class ###Component###ModelImport extends JModelLegacy
// Recall the 'Import from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
$this->setState('import.directory', $path);
// set uploading values
$this->use_streams = false;
$this->allow_unsafe = false;
$this->safeFileOptions = array();
parent::populateState();
}
@ -285,21 +286,16 @@ class ###Component###ModelImport extends JModelLegacy
}
// check the extention
switch(strtolower(pathinfo($p_dir, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
if(!$this->checkExtension($p_dir))
{
// set error message
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
$package['dir'] = $p_dir;
$package['type'] = $type;
return $package;
}
@ -357,21 +353,15 @@ class ###Component###ModelImport extends JModelLegacy
$archivename = JPath::clean($archivename);
// check the extention
switch(strtolower(pathinfo($archivename, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
if(!$this->checkExtension($archivename))
{
// Cleanup the import files
$this->remove($archivename);
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
}
$config = JFactory::getConfig();
$config = JFactory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
@ -384,6 +374,28 @@ class ###Component###ModelImport extends JModelLegacy
return $check;
}
/**
* Check the extension
*
* @param string $file Name of the uploaded file
*
* @return boolean True on success
*
*/
protected function checkExtension($file)
{
// check the extention
switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
{
case 'xls':
case 'ods':
case 'csv':
return true;
break;
}
return false;
}
/**
* Clean up temporary uploaded spreadsheet
*

View File

@ -34,6 +34,11 @@ defined('_JEXEC') or die('Restricted access');
*/
class ###Component###Model###View### extends JModelLegacy
{
// set uploading values
protected $use_streams = false;
protected $allow_unsafe = false;
protected $safeFileOptions = array();
/**
* @var object JTable object
*/
@ -75,10 +80,6 @@ class ###Component###Model###View### extends JModelLegacy
// Recall the 'Import from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
$this->setState('import.directory', $path);
// set uploading values
$this->use_streams = false;
$this->allow_unsafe = false;
$this->safeFileOptions = array();
parent::populateState();
}
###IMPORT_METHOD_CUSTOM###
@ -175,21 +176,16 @@ class ###Component###Model###View### extends JModelLegacy
}
// check the extention
switch(strtolower(pathinfo($p_dir, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
if(!$this->checkExtension($p_dir))
{
// set error message
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
$package['dir'] = $p_dir;
$package['type'] = $type;
return $package;
}
@ -247,21 +243,15 @@ class ###Component###Model###View### extends JModelLegacy
$archivename = JPath::clean($archivename);
// check the extention
switch(strtolower(pathinfo($archivename, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
if(!$this->checkExtension($archivename))
{
// Cleanup the import files
$this->remove($archivename);
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
}
$config = JFactory::getConfig();
$config = JFactory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
@ -273,6 +263,7 @@ class ###Component###Model###View### extends JModelLegacy
return $check;
}
###IMPORT_EXT_METHOD_CUSTOM###
/**
* Clean up temporary uploaded spreadsheet

View File

@ -142,7 +142,7 @@ class ###Component###View###Views### extends JViewLegacy
{
JToolbarHelper::trash('###views###.trash');
}###EXPORTBUTTON###
}###IMPORTBUTTON###
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON###
// set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###views###');

View File

@ -60,8 +60,7 @@
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB/en-GB.com_###component###.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_###component###.sys.ini</language>
###SITE_LANGUAGES###
</languages>
<administration>
@ -86,8 +85,7 @@
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_###component###.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_###component###.sys.ini</language>
###ADMIN_LANGUAGES###
</languages>
</administration>###UPDATESERVER###

View File

@ -29,30 +29,27 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$manifest = ###Component###Helper::manifest();
JHtml::_('bootstrap.loadCss');
?>
<img alt="<?php echo JText::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/component-300.###COMP_IMAGE_TYPE###">
<img alt="<?php echo JText::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/vdm-component.###COMP_IMAGE_TYPE###">
<ul class="list-striped">
<li><b><?php echo JText::_('COM_###COMPONENT###_VERSION'); ?>:</b> <?php echo $manifest->version; ?></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_DATE'); ?>:</b> <?php echo $manifest->creationDate; ?></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $manifest->authorEmail; ?>"><?php echo $manifest->author; ?></a></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_WEBSITE'); ?>:</b> <a href="<?php echo $manifest->authorUrl; ?>" target="_blank"><?php echo $manifest->authorUrl; ?></a></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_LICENSE'); ?>:</b> <?php echo $manifest->license; ?></li>
<li><b><?php echo $manifest->copyright; ?></b></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?>&nbsp;&nbsp;<span class="update-notice"></span></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $this->manifest->authorEmail; ?>"><?php echo $this->manifest->author; ?></a></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_WEBSITE'); ?>:</b> <a href="<?php echo $this->manifest->authorUrl; ?>" target="_blank"><?php echo $this->manifest->authorUrl; ?></a></li>
<li><b><?php echo JText::_('COM_###COMPONENT###_LICENSE'); ?>:</b> <?php echo $this->manifest->license; ?></li>
<li><b><?php echo $this->manifest->copyright; ?></b></li>
</ul>
<div class="clearfix"></div>
<?php if(###Component###Helper::checkArray($this->contributors)): ?>
<?php if(count($this->contributors) > 1): ?>
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTORS'); ?></h3>
<?php else: ?>
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTOR'); ?></h3>
<?php endif; ?>
<ul class="list-striped">
<?php foreach($this->contributors as $contributor): ?>
<li><b><?php echo $contributor['title']; ?>:</b> <?php echo $contributor['name']; ?></li>
<?php endforeach; ?>
</ul>
<div class="clearfix"></div>
<?php if(count($this->contributors) > 1): ?>
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTORS'); ?></h3>
<?php else: ?>
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTOR'); ?></h3>
<?php endif; ?>
<ul class="list-striped">
<?php foreach($this->contributors as $contributor): ?>
<li><b><?php echo $contributor['title']; ?>:</b> <?php echo $contributor['name']; ?></li>
<?php endforeach; ?>
</ul>
<div class="clearfix"></div>
<?php endif; ?>

View File

@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
class HeaderCheck
class ###component###HeaderCheck
{
function js_loaded($script_name)
{

View File

@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
class HeaderCheck
class ###component###HeaderCheck
{
function js_loaded($script_name)
{

View File

@ -1,6 +1,11 @@
###INSTALL###
--
-- Always insure this column is large enough for all the access control values.
-- Always insure this column rules is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';
--
-- Always insure this column name is large enough for long component and view names.
--
ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';

View File

@ -157,24 +157,19 @@
"rename": "Helper_site",
"type": "file"
},
"Helper_category.php": {
"naam":"Helper_category.php",
"path": "c0mp0n3nt/site/helpers",
"rename": "new",
"newName": "category.php",
"type": "file"
},
"script.php": {
"naam":"script.php",
"path": "c0mp0n3nt/",
"rename": false,
"type": "file"
},
"en-GB.com_admin.ini": {
"naam":"en-GB.com_admin.ini",
"path": "c0mp0n3nt/admin/language/en-GB",
"rename": "admin",
"type": "file"
},
"en-GB.com_admin.sys.ini": {
"naam":"en-GB.com_admin.sys.ini",
"path": "c0mp0n3nt/admin/language/en-GB",
"rename": "admin",
"type": "file"
},
"install.mysql.utf8.sql": {
"naam":"install.mysql.utf8.sql",
"path": "c0mp0n3nt/admin/sql",
@ -212,18 +207,6 @@
"rename": false,
"type": "file"
},
"en-GB.com_site.ini": {
"naam":"en-GB.com_site.ini",
"path": "c0mp0n3nt/site/language/en-GB",
"rename": "site",
"type": "file"
},
"en-GB.com_site.sys.ini": {
"naam":"en-GB.com_site.sys.ini",
"path": "c0mp0n3nt/site/language/en-GB",
"rename": "site",
"type": "file"
},
"headercheck.php": {
"naam":"headercheck.php",
"path": "c0mp0n3nt/site/helpers",
@ -677,6 +660,11 @@
"rename": "new",
"newName": "submitbutton.js",
"type": "custom_form"
},
"Helper_category_view.php": {
"path": "c0mp0n3nt/site/helpers",
"rename": "Helper_category_view",
"type": "category"
}
},
"custom_admin": {

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@ -43,8 +43,12 @@ $document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css')
$document->addScript('components/com_componentbuilder/assets/js/admin.js');
// require helper files
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
// Triger the Global Admin Event
ComponentbuilderHelper::globalEvent($document);
// import joomla controller library
jimport('joomla.application.component.controller');

View File

@ -61,8 +61,30 @@
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Percentagelanguageadd Field. Type: Number. (joomla) -->
<field
type="number"
name="percentagelanguageadd"
label="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_LABEL"
default="50"
description="COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION"
class="text_area"
required="true"
min="10"
max="100"
step="10"
/>
<!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_a" hr="true" class="spacer_hr_a" />
<field type="spacer" name="spacer_hr_a" hr="true" class="spacer_hr_a" />
<!-- Api Field. Type: User. (joomla) -->
<field
type="user"
name="api"
label="COM_COMPONENTBUILDER_CONFIG_API_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION"
/>
<!-- 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"
type="spacer"
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"
@ -133,6 +155,340 @@
COM_COMPONENTBUILDER_CONFIG_GRADIANT_LOAD</option>"
</field>
</fieldset>
<fieldset
name="mail_configuration_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION">
<!-- Mailonline Field. Type: Radio. (joomla) -->
<field
type="radio"
name="mailonline"
label="COM_COMPONENTBUILDER_CONFIG_MAILONLINE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_MAILONLINE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_ON</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_OFF</option>
</field>
<!-- Mailer Field. Type: List. (joomla) -->
<field
type="list"
name="mailer"
label="COM_COMPONENTBUILDER_CONFIG_MAILER_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_MAILER_DESCRIPTION"
class="list_class"
multiple="false"
filter="WORD"
required="true"
default="global">
<!-- Option Set. -->
<option value="global">
COM_COMPONENTBUILDER_CONFIG_GLOBAL</option>
<option value="default">
COM_COMPONENTBUILDER_CONFIG_PHP_MAIL</option>
<option value="sendmail">
COM_COMPONENTBUILDER_CONFIG_SENDMAIL</option>
<option value="smtp">
COM_COMPONENTBUILDER_CONFIG_SMTP</option>
</field>
<!-- Emailfrom Field. Type: Text. (joomla) -->
<field
type="text"
name="emailfrom"
label="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_DESCRIPTION"
class="text_area"
filter="STRING"
validate="email"
message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_HINT"
showon="mailer:smtp,sendmail,default"
/>
<!-- Fromname Field. Type: Text. (joomla) -->
<field
type="text"
name="fromname"
label="COM_COMPONENTBUILDER_CONFIG_FROMNAME_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_FROMNAME_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_FROMNAME_HINT"
showon="mailer:smtp,sendmail,default"
/>
<!-- Email reply to Field. Type: Text. (joomla) -->
<field
type="text"
name="replyto"
label="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_DESCRIPTION"
class="text_area"
filter="STRING"
validate="email"
message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_HINT"
showon="mailer:smtp,sendmail,default"
/>
<!-- Reply to name Field. Type: Text. (joomla) -->
<field
type="text"
name="replytoname"
label="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT"
showon="mailer:smtp,sendmail,default"
/>
<!-- Sendmail Field. Type: Text. (joomla) -->
<field
type="text"
name="sendmail"
label="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_DESCRIPTION"
class="text_area"
required="false"
filter="PATH"
message="Error! Please add path to you local sendmail here."
hint="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_HINT"
showon="mailer:sendmail"
/>
<!-- Smtpauth Field. Type: Radio. (joomla) -->
<field
type="radio"
name="smtpauth"
label="COM_COMPONENTBUILDER_CONFIG_SMTPAUTH_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_SMTPAUTH_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0"
showon="mailer:smtp">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Smtpsecure Field. Type: List. (joomla) -->
<field
type="list"
name="smtpsecure"
label="COM_COMPONENTBUILDER_CONFIG_SMTPSECURE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_SMTPSECURE_DESCRIPTION"
class="list_class"
multiple="false"
filter="WORD"
default="none"
showon="mailer:smtp">
<!-- Option Set. -->
<option value="none">
COM_COMPONENTBUILDER_CONFIG_NONE</option>
<option value="ssl">
COM_COMPONENTBUILDER_CONFIG_SSL</option>
<option value="tls">
COM_COMPONENTBUILDER_CONFIG_TLS</option>
</field>
<!-- Smtpport Field. Type: Text. (joomla) -->
<field
type="text"
name="smtpport"
label="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_LABEL"
size="60"
maxlength="150"
default="25"
description="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_DESCRIPTION"
class="text_area"
filter="INT"
message="Error! Please add the port number of your SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_HINT"
showon="mailer:smtp"
/>
<!-- Smtpuser Field. Type: Text. (joomla) -->
<field
type="text"
name="smtpuser"
label="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add the username for SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_HINT"
showon="mailer:smtp"
/>
<!-- Smtppass Field. Type: Password. (joomla) -->
<field
type="password"
name="smtppass"
label="COM_COMPONENTBUILDER_CONFIG_SMTPPASS_LABEL"
size="60"
description="COM_COMPONENTBUILDER_CONFIG_SMTPPASS_DESCRIPTION"
class="text_area"
filter="raw"
message="Error! Please add the password for SMTP server here."
showon="mailer:smtp"
/>
<!-- Smtphost Field. Type: Text. (joomla) -->
<field
type="text"
name="smtphost"
label="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_LABEL"
size="60"
maxlength="150"
default="localhost"
description="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add the name of the SMTP host here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_HINT"
showon="mailer:smtp"
/>
</fieldset>
<fieldset
name="dkim_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_DKIM">
<!-- Dkim Field. Type: Radio. (joomla) -->
<field
type="radio"
name="dkim"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Dkim_domain Field. Type: Text. (joomla) -->
<field
type="text"
name="dkim_domain"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add DKIM Domain here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_HINT"
showon="dkim:1"
onchange="vdm_dkim();"
/>
<!-- Dkim_selector Field. Type: Text. (joomla) -->
<field
type="text"
name="dkim_selector"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_LABEL"
size="60"
maxlength="150"
default="vdm"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add DKIM/DNS selector here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_HINT"
showon="dkim:1"
onchange="vdm_dkim();"
/>
<!-- Dkim_passphrase Field. Type: Password. (joomla) -->
<field
type="password"
name="dkim_passphrase"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PASSPHRASE_LABEL"
size="60"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PASSPHRASE_DESCRIPTION"
class="text_area"
filter="raw"
message="Error! Please add passphrase here."
showon="dkim:1"
/>
<!-- Dkim_identity Field. Type: Text. (joomla) -->
<field
type="text"
name="dkim_identity"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_DESCRIPTION"
class="text_area"
filter="raw"
message="Error! Please add DKIM Identity here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_HINT"
showon="dkim:1"
/>
<!-- Dkim_private_key Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="dkim_private_key"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_LABEL"
rows="15"
cols="5"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_DESCRIPTION"
class="input-xxlarge span12"
showon="dkim:1"
/>
<!-- Dkim_public_key Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="dkim_public_key"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PUBLIC_KEY_LABEL"
rows="5"
cols="5"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PUBLIC_KEY_DESCRIPTION"
class="input-xxlarge span12"
showon="dkim:1"
onchange="vdm_dkim();"
/>
<!-- Note_dkim_use Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_dkim_use" label="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION" heading="h4" class="note_dkim_use" showon="dkim:1" />
<!-- Dkim_key Field. Type: Text. (joomla) -->
<field
type="text"
name="dkim_key"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add KEY here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_HINT"
showon="dkim:1"
/>
<!-- Dkim_value Field. Type: Text. (joomla) -->
<field
type="text"
name="dkim_value"
label="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_LABEL"
size="80"
maxlength="350"
description="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_DESCRIPTION"
class="text_area"
filter="STRING"
message="Error! Please add TXT record here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_HINT"
showon="dkim:1"
/>
</fieldset>
<fieldset
name="encryption_config"
label="COM_COMPONENTBUILDER_CONFIG_ENCRYPTION_LABEL"
@ -146,6 +502,62 @@
default=""
/>
</fieldset>
<fieldset
name="cronjob_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB">
<!-- 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" />
<!-- Cronjob_backup_folder_path Field. Type: Text. (joomla) -->
<field
type="text"
name="cronjob_backup_folder_path"
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL"
size="70"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="false"
filter="PATH"
message="Error! Please add some text here."
hint="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT"
/>
<!-- Backup_email Field. Type: Text. (joomla) -->
<field
type="text"
name="backup_email"
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_LABEL"
size="10"
maxlength="50"
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION"
class="text_area"
filter="STRING"
validate="email"
message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_HINT"
/>
<!-- Package_name_plaeholders Field. Type: Note. A None Database Field. (joomla) -->
<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" />
<!-- Backup_package_name Field. Type: Text. (joomla) -->
<field
type="text"
name="backup_package_name"
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_LABEL"
size="40"
maxlength="150"
default="JCB_Backup_[YEAR]_[MONTH]_[DAY]"
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="true"
filter="STRING"
message="Error! Please add name here."
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_HINT"
/>
</fieldset>
<fieldset
name="folder_paths_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_FOLDER_PATHS">
@ -222,6 +634,116 @@
message="Error! Please add folder path here."
hint="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT"
/>
</fieldset>
<fieldset
name="company_custom_config"
label="COM_COMPONENTBUILDER_CONFIG_COMPANY">
<!-- Export_company Field. Type: Text. (joomla) -->
<field
type="text"
name="export_company"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="true"
filter="STRING"
message="Error! Please add company name here."
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COMPANY_HINT"
/>
<!-- Export_owner Field. Type: Text. (joomla) -->
<field
type="text"
name="export_owner"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_LABEL"
size="10"
maxlength="120"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="true"
filter="HTML"
message="Error! Please add owner name here."
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_OWNER_HINT"
/>
<!-- Export_email Field. Type: Text. (joomla) -->
<field
type="text"
name="export_email"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
validate="email"
message="Error! Please email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_HINT"
/>
<!-- Export_website Field. Type: Url. (joomla) -->
<field
type="url"
name="export_website"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_LABEL"
size="60"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_DESCRIPTION"
class="text_area"
required="true"
filter="url"
validated="url"
message="Error! Please add website here."
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_WEBSITE_HINT"
/>
<!-- Export_license Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="export_license"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_LABEL"
rows="7"
cols="10"
default="GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_DESCRIPTION"
class="text_area span12"
filter="HTML"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_HINT"
required="true"
/>
<!-- Export_copyright Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="export_copyright"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_LABEL"
rows="7"
cols="10"
default="Copyright (C) 2015. All Rights Reserved"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_DESCRIPTION"
class="text_area span12"
filter="HTML"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_COPYRIGHT_HINT"
required="true"
/>
<!-- Export_buy_link Field. Type: Url. (joomla) -->
<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
name="permissions"

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage controller.php
@ -99,6 +99,8 @@ class ComponentbuilderController extends JControllerLegacy
'snippet' => 'snippets',
'field' => 'fields',
'fieldtype' => 'fieldtypes',
'language_translation' => 'language_translations',
'language' => 'languages',
'help_document' => 'help_documents'
);
// check if this is a list view

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 99 of this MVC
@build 1st March, 2017
@version @update number 111 of this MVC
@build 17th July, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 99 of this MVC
@build 1st March, 2017
@version @update number 111 of this MVC
@build 17th July, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.json.php
@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('isNew', 'ajax');
$this->registerTask('isRead', 'ajax');
$this->registerTask('getComponentDetails', 'ajax');
$this->registerTask('getCronPath', 'ajax');
$this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getImportScripts', 'ajax');
@ -57,7 +58,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('viewTableColumns', 'ajax');
$this->registerTask('checkFunctionName', 'ajax');
$this->registerTask('usedin', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('getBuildTable', 'ajax');
$this->registerTask('getButton', 'ajax');
}
public function ajax()
@ -186,6 +189,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getCronPath':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$getTypeValue = $jinput->get('getType', NULL, 'WORD');
if($getTypeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getCronPath($getTypeValue);
}
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 'tableColumns':
try
{
@ -687,6 +728,83 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
echo "(".json_encode($e).");";
}
}
break;
case 'getBuildTable':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idNameValue = $jinput->get('idName', NULL, 'CMD');
$objectValue = $jinput->get('object', NULL, 'STRING');
if($idNameValue && $objectValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getBuildTable($idNameValue, $objectValue);
}
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 'getButton':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$typeValue = $jinput->get('type', NULL, 'WORD');
if($typeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getButton($typeValue);
}
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;
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 26 of this MVC
@build 28th February, 2017
@version @update number 53 of this MVC
@build 5th August, 2017
@created 1st February, 2017
@package Component Builder
@subpackage compiler.php
@ -66,9 +66,9 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
if($user->authorise('core.admin', 'com_componentbuilder'))
{
// get the post values
$jinput = JFactory::getApplication()->input;
$jinput = JFactory::getApplication()->input;
$componentId = $jinput->post->get('component', 0, 'INT');
$version = $jinput->post->get('version', 0, 'INT');
$version = $jinput->post->get('version', 0, 'INT');
$addBackup = $jinput->post->get('backup', 0, 'INT');
$addGit = $jinput->post->get('git', 0, 'INT');
$addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
@ -93,62 +93,37 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
if (empty($redirect_url) && $componentId > 0)
{
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
// setup the unrealistic numbers
$counter = $model->getCount();
$folders = $counter['folders'] * 5;
$files = $counter['files'] * 5;
$lines = $counter['lines'] * 10;
$seconds = $folders + $files + $lines;
$totalHours = round($seconds / 3600);
$totalDays = round($totalHours / 8);
// setup the more realistic numbers
$debugging = $seconds / 4;
$planning = $seconds / 7;
$mapping = $seconds / 10;
$office = $seconds / 6;
$seconds = $folders + $files + $lines + $debugging + $planning + $mapping + $office;
$actualTotalHours = round($seconds / 3600);
$actualTotalDays = round($actualTotalHours / 8);
$debuggingHours = round($debugging / 3600);
$planningHours = round($planning / 3600);
$mappingHours = round($mapping / 3600);
$officeHours = round($office / 3600);
// the actual time spent
$actualHoursSpent = $actualTotalHours - $totalHours;
$actualDaysSpent = $actualTotalDays - $totalDays;
// calculate the projects actual time frame of completion
$projectWeekTime = round($actualTotalDays / 5,1);
$projectMonthTime = round($actualTotalDays / 24,1);
if (($pos = strpos($counter['filePath'], "/tmp/")) !== FALSE)
if (($pos = strpos($model->compiler->filepath, "/tmp/")) !== FALSE)
{
$url = JURI::root() . substr($counter['filePath'], $pos + 1);
$url = JURI::root() . substr($model->compiler->filepath, $pos + 1);
}
// Message of successful build
$message = '<h1>The ('.$counter['filename'].') Was Successfully Compiled!</h1>';
$message = '<h1>The ('.$model->compiler->componentFolderName.') Was Successfully Compiled!</h1>';
$message .= '<p><button class="btn btn-small btn-success" onclick="Joomla.submitbutton(\'compiler.installExtention\')">';
$message .= 'Install '.$counter['filename'].' on this <span class="icon-joomla icon-white"></span>Joomla website.</button></p>';
$message .= 'Install '.$model->compiler->componentFolderName.' on this <span class="icon-joomla icon-white"></span>Joomla website.</button></p>';
$message .= '<h2>Total time saved</h2>';
$message .= '<ul>';
$message .= '<li>Total folders created: <b>'.$counter['folders'].'</b></li>';
$message .= '<li>Total files created: <b>'.$counter['files'].'</b></li>';
$message .= '<li>Total lines written: <b>'.$counter['lines'].'</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 lines written: <b>'.$model->compiler->lineCount.'</b></li>';
$message .= '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>';
$message .= '</ul>';
$message .= '<p><b>'.$totalHours.' Hours</b> or <b>'.$totalDays.' Eight Hour Days</b> <em>(actual time you saved)</em><br />';
$message .= '<p><b>'.$model->compiler->totalHours.' Hours</b> or <b>'.$model->compiler->totalDays.' Eight Hour Days</b> <em>(actual time you saved)</em><br />';
$message .= '<small>(if creating a folder and file took <b>5 seconds</b> and writing one line of code took <b>10 seconds</b>, never making one mistake or taking any coffee break.)</small><br />';
$message .= '<b>'.$actualHoursSpent.' Hours</b> or <b>'.$actualDaysSpent.' Eight Hour Days</b> <em>(the actual time you spent)</em><br />';
$message .= '<small>(with the following break down: <b>debugging @'.$debuggingHours.'hours</b> = codingtime / 4; <b>planning @'.$planningHours.'hours</b> = codingtime / 7; <b>mapping @'.$mappingHours.'hours</b> = codingtime / 10; <b>office @'.$officeHours.'hours</b> = codingtime / 6;)</small></p>';
$message .= '<p><b>'.$actualTotalHours.' Hours</b> or <b>'.$actualTotalDays.' Eight Hour Days</b> <em>(a total of the realistic time frame for this project)</em><br />';
$message .= '<b>'.$model->compiler->actualHoursSpent.' Hours</b> or <b>'.$model->compiler->actualDaysSpent.' Eight Hour Days</b> <em>(the actual time you spent)</em><br />';
$message .= '<small>(with the following break down: <b>debugging @'.$model->compiler->debuggingHours.'hours</b> = codingtime / 4; <b>planning @'.$model->compiler->planningHours.'hours</b> = codingtime / 7; <b>mapping @'.$model->compiler->mappingHours.'hours</b> = codingtime / 10; <b>office @'.$model->compiler->officeHours.'hours</b> = codingtime / 6;)</small></p>';
$message .= '<p><b>'.$model->compiler->actualTotalHours.' Hours</b> or <b>'.$model->compiler->actualTotalDays.' Eight Hour Days</b> <em>(a total of the realistic time frame for this project)</em><br />';
$message .= '<small>(if creating a folder and file took <b>5 seconds</b> and writing one line of code took <b>10 seconds</b>, with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)</small></p>';
$message .= '<p>Project duration: <b>'.$projectWeekTime. ' weeks</b> or <b>'.$projectMonthTime.' months</b></p>';
$message .= '<p>Project duration: <b>'.$model->compiler->projectWeekTime. ' weeks</b> or <b>'.$model->compiler->projectMonthTime.' months</b></p>';
$message .= '<h2>Path to Zip File</h2>';
$message .= '<p><b>Path:</b> <code>'.$counter['filePath'].'</code><br />';
$message .= '<p><b>Path:</b> <code>'.$model->compiler->filepath.'</code><br />';
$message .= '<b>URL:</b> <code>'.$url.'</code><br /><br />';
$message .= '<small>Hey! you can also download the file right now!</small><br /><a class="btn btn-success" href="'.$url.'" ><span class="icon-download icon-white"></span>Download</a></p>';
$message .= '<p><small><b>Remember!</b> This file is in your tmp folder and therefore publicly accessible untill you click [Clear tmp]!</small> </p>';
$message .= '<p><small>Compilation took <b>'.$counter['time'].'</b> seconds to complete.</small> </p>';
$message .= '<p><small>Compilation took <b>'.$model->compiler->secondsCompiled.'</b> seconds to complete.</small> </p>';
// set redirect
$this->setRedirect($redirect_url,$message,'message');
$app->setUserState('com_componentbuilder.extension_name', $counter['filename']);
$app->setUserState('com_componentbuilder.extension_name', $model->compiler->componentFolderName);
}
else
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 1st March, 2017
@build 17th July, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 1st March, 2017
@build 17th July, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 26th April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 26th April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 15th January, 2017
@version @update number 84 of this MVC
@build 4th May, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_get.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 15th January, 2017
@version @update number 84 of this MVC
@build 4th May, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_gets.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 37 of this MVC
@build 3rd February, 2017
@version @update number 38 of this MVC
@build 28th May, 2017
@created 30th April, 2015
@package Component Builder
@subpackage field.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 37 of this MVC
@build 3rd February, 2017
@version @update number 38 of this MVC
@build 28th May, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 12 of this MVC
@build 20th October, 2016
@version @update number 13 of this MVC
@build 13th June, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 12 of this MVC
@build 20th October, 2016
@version @update number 13 of this MVC
@build 13th June, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 6 of this MVC
@build 17th October, 2016
@build 18th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 6 of this MVC
@build 17th October, 2016
@build 18th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_documents.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -0,0 +1,67 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import_joomla_components.php
@author Llewellyn van der Merwe <http://vdm.bz/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');
/**
* Componentbuilder Import_joomla_components Controller
*/
class ComponentbuilderControllerImport_joomla_components extends JControllerLegacy
{
/**
* Import an spreadsheet.
*
* @return void
*/
public function import()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('Import_joomla_components');
if ($model->import())
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components', false);
}
else
{
// wipe out the user state when we're going to redirect
$app->setUserState('com_componentbuilder.redirect_url', '');
$app->setUserState('com_componentbuilder.message', '');
$app->setUserState('com_componentbuilder.extension_message', '');
}
$this->setRedirect($redirect_url);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 96 of this MVC
@build 17th February, 2017
@version @update number 359 of this MVC
@build 23rd August, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 96 of this MVC
@build 17th February, 2017
@version @update number 359 of this MVC
@build 23rd August, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_components.php
@ -99,7 +99,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$session->set('dataType_VDM_IMPORTINTO', 'joomla_component');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components', false), $message);
return;
}
}
@ -107,5 +107,286 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
public function smartImport()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$model->user = JFactory::getUser();
if ($model->user->authorise('joomla_component.import', 'com_componentbuilder') && $model->user->authorise('core.import', 'com_componentbuilder'))
{
$session = JFactory::getSession();
$session->set('backto_VDM_IMPORT', 'joomla_components');
$session->set('dataType_VDM_IMPORTINTO', 'smart_package');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message);
return;
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
public function smartExport()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// Get the model
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.
$model->user = JFactory::getUser();
if ($model->user->authorise('joomla_component.export', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
// check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks))
{
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
// set auto loader
ComponentbuilderHelper::autoLoader('smart');
// get the data to export
if ($model->getSmartExport($pks))
{
// set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
{
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEYBR_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY') . '</h1>';
// set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
$ownerDetails .= '<ul>';
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
}
// add value only if set
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
}
// add value only if set
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
}
// add value only if set
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
}
// add value only if set
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
}
// add value only if set
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
}
$ownerDetails .= '</ul>';
}
else
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '</p>';
$ownerDetails .= '<h3>' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '</p>';
}
}
else
{
$keyNotice = '<h1>' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
$ownerDetails = '<p>' . JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '</p>';
}
// Redirect to the list screen with success.
$message = array();
$message[] = '<h1>' . JText::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '</h1>';
$message[] = '<p>' . JText::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '</p>';
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success');
return;
}
else
{
if (componentbuilderHelper::checkString($model->packagePath))
{
// clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath);
}
if (componentbuilderHelper::checkString($model->zipPath))
{
// clear all if not successful
JFile::delete($model->zipPath);
}
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
public function backup()
{
// get params
if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params))
{
$this->params = JComponentHelper::getParams('com_componentbuilder');
}
// get all component IDs to backup
$pks = componentbuilderHelper::getComponentIDs();
// Get the model
$model = componentbuilderHelper::getModel('joomla_components', JPATH_ADMINISTRATOR . '/components/com_componentbuilder');
// set user
$model->user = $this->getApiUser();
// make sure to set active type to backup
$model->activeType = 'manualBackup';
// set auto loader
ComponentbuilderHelper::autoLoader('smart');
// manual backup message
$backupNotice = array();
// get the data to export
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks))
{
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY');
$backupNoticeStatus = 'Success';
// set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
{
$textNotice = array();
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key);
$keyNotice .= JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE') . '<br />';
// set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
$ownerDetails .= '<ul>';
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']);
}
$ownerDetails .= '</ul>';
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET');
}
else
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
$ownerDetails .= JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '<br />';
$textNotice[] = JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE');
$ownerDetails .= '<h3>' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
$textNotice[] = '## ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS');
$ownerDetails .= JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '<br />';
$textNotice[] = JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT');
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE');
}
}
else
{
$keyNotice = '<h1>' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY');
$ownerDetails = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '<br />';
$textNotice[] = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY');
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY');
}
// get email
if ($email = $this->params->get('backup_email', null))
{
// plain text
$plainText = implode("\n", $textNotice);
// set hash to track changes
$hashTracker = md5($plainText);
if (ComponentbuilderHelper::newHash($hashTracker))
{
// Build final massage.
$message = $keyNotice . $ownerDetails . '<br /><small>HASH: ' . $hashTracker . '</small>';
// set the subject
$subject = JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY');
// email the message
componentbuilderEmail::send($email, $subject, componentbuilderEmail::setTableBody($message, $subject), $plainText, 1);
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND');
}
else
{
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED');
}
}
}
else
{
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR');
$backupNoticeStatus = 'Error';
if (componentbuilderHelper::checkString($model->packagePath))
{
// clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath);
}
if (componentbuilderHelper::checkString($model->zipPath))
{
// clear all if not successful
JFile::delete($model->zipPath);
}
}
// quite only if auto backup (adding this script from custom code :)
if ('backup' === 'manualBackup')
{
echo "# " . $backupNoticeStatus . "\n" .implode("\n", $backupNotice);
jexit();
}
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("<br />", $backupNotice), $backupNoticeStatus);
return;
}
protected function getApiUser()
{
// admin area does not have API user, only front-end (so we fallback on login user)
return JFactory::getUser();
}
}

View File

@ -0,0 +1,326 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 3rd April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language.php
@author Llewellyn van der Merwe <http://vdm.bz/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');
/**
* Language Controller
*/
class ComponentbuilderControllerLanguage 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 = 'Languages'; // 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('language.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('language.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('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('language.edit', 'com_componentbuilder.language.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('language.edit.own', 'com_componentbuilder.language.' . $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('language.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('language.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('Language', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages' . $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 @update number 39 of this MVC
@build 7th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translation.php
@author Llewellyn van der Merwe <http://vdm.bz/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');
/**
* Language_translation Controller
*/
class ComponentbuilderControllerLanguage_translation 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 = 'Language_translations'; // 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('language_translation.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('language_translation.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('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('language_translation.edit', 'com_componentbuilder.language_translation.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('language_translation.edit.own', 'com_componentbuilder.language_translation.' . $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('language_translation.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('language_translation.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('Language_translation', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations' . $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,111 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 39 of this MVC
@build 7th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translations.php
@author Llewellyn van der Merwe <http://vdm.bz/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');
/**
* Language_translations Controller
*/
class ComponentbuilderControllerLanguage_translations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Language_translation', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
public function exportData()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language_translation.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Language_translations');
// get the data to export
$data = $model->getExportData($pks);
if (ComponentbuilderHelper::checkArray($data))
{
// now set the data to the spreadsheet
$date = JFactory::getDate();
ComponentbuilderHelper::xls($data,'Language_translations_'.$date->format('jS_F_Y'),'Language translations exported ('.$date->format('jS F, Y').')','language translations');
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
return;
}
public function importData()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language_translation.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
// Get the import model
$model = $this->getModel('Language_translations');
// get the headers to import
$headers = $model->getExImPortHeaders();
if (ComponentbuilderHelper::checkObject($headers))
{
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('language_translation_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'language_translations');
$session->set('dataType_VDM_IMPORTINTO', 'language_translation');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
return;
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
return;
}
}

View File

@ -0,0 +1,111 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 3rd April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage languages.php
@author Llewellyn van der Merwe <http://vdm.bz/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');
/**
* Languages Controller
*/
class ComponentbuilderControllerLanguages extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGES';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Language', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
public function exportData()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Languages');
// get the data to export
$data = $model->getExportData($pks);
if (ComponentbuilderHelper::checkArray($data))
{
// now set the data to the spreadsheet
$date = JFactory::getDate();
ComponentbuilderHelper::xls($data,'Languages_'.$date->format('jS_F_Y'),'Languages exported ('.$date->format('jS F, Y').')','languages');
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error');
return;
}
public function importData()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
// Get the import model
$model = $this->getModel('Languages');
// get the headers to import
$headers = $model->getExImPortHeaders();
if (ComponentbuilderHelper::checkObject($headers))
{
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('language_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'languages');
$session->set('dataType_VDM_IMPORTINTO', 'language');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
return;
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error');
return;
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 67 of this MVC
@build 22nd February, 2017
@version @update number 77 of this MVC
@build 30th May, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layout.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 67 of this MVC
@build 22nd February, 2017
@version @update number 77 of this MVC
@build 30th May, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layouts.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 1st March, 2017
@version @update number 51 of this MVC
@build 17th July, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 1st March, 2017
@version @update number 51 of this MVC
@build 17th July, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_views.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 22nd February, 2017
@build 1st April, 2017
@created 26th May, 2015
@package Component Builder
@subpackage template.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 22nd February, 2017
@build 1st April, 2017
@created 26th May, 2015
@package Component Builder
@subpackage templates.php

View File

@ -464,4 +464,3 @@ class Dropbox
return function_exists('curl_version');
}
}

232
admin/custom/timeago.js Normal file
View File

@ -0,0 +1,232 @@
/**
* Timeago is a jQuery plugin that makes it easy to support automatically
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
*
* @name timeago
* @version 1.5.4
* @requires jQuery v1.2.3+
* @author Ryan McGeary
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*
* For usage and examples, visit:
* http://timeago.yarp.com/
*
* Copyright (c) 2008-2017, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) {
return inWords(timestamp);
} else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp));
} else if (typeof timestamp === "number") {
return inWords(new Date(timestamp));
} else {
return inWords($.timeago.datetime(timestamp));
}
};
var $t = $.timeago;
$.extend($.timeago, {
settings: {
refreshMillis: 60000,
allowPast: true,
allowFuture: false,
localeTitle: false,
cutoff: 0,
autoDispose: true,
strings: {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
inPast: 'any moment now',
seconds: "less than a minute",
minute: "about a minute",
minutes: "%d minutes",
hour: "about an hour",
hours: "about %d hours",
day: "a day",
days: "%d days",
month: "about a month",
months: "%d months",
year: "about a year",
years: "%d years",
wordSeparator: " ",
numbers: []
}
},
inWords: function(distanceMillis) {
if (!this.settings.allowPast && ! this.settings.allowFuture) {
throw 'timeago allowPast and allowFuture settings can not both be set to false.';
}
var $l = this.settings.strings;
var prefix = $l.prefixAgo;
var suffix = $l.suffixAgo;
if (this.settings.allowFuture) {
if (distanceMillis < 0) {
prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow;
}
}
if (!this.settings.allowPast && distanceMillis >= 0) {
return this.settings.strings.inPast;
}
var seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
var years = days / 365;
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number;
return string.replace(/%d/i, value);
}
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
days < 30 && substitute($l.days, Math.round(days)) ||
days < 45 && substitute($l.month, 1) ||
days < 365 && substitute($l.months, Math.round(days / 30)) ||
years < 1.5 && substitute($l.year, 1) ||
substitute($l.years, Math.round(years));
var separator = $l.wordSeparator || "";
if ($l.wordSeparator === undefined) { separator = " "; }
return $.trim([prefix, words, suffix].join(separator));
},
parse: function(iso8601) {
var s = $.trim(iso8601);
s = s.replace(/\.\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/");
s = s.replace(/T/," ").replace(/Z/," UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900
return new Date(s);
},
datetime: function(elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601);
},
isTime: function(elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
}
});
// functions that can be called via $(el).timeago('action')
// init is default when no action is given
// functions are called with context of a single element
var functions = {
init: function() {
functions.dispose.call(this);
var refresh_el = $.proxy(refresh, this);
refresh_el();
var $s = $t.settings;
if ($s.refreshMillis > 0) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
}
},
update: function(timestamp) {
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
$(this).data('timeago', { datetime: date });
if ($t.settings.localeTitle) {
$(this).attr("title", date.toLocaleString());
}
refresh.apply(this);
},
updateFromDOM: function() {
$(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
refresh.apply(this);
},
dispose: function () {
if (this._timeagoInterval) {
window.clearInterval(this._timeagoInterval);
this._timeagoInterval = null;
}
}
};
$.fn.timeago = function(action, options) {
var fn = action ? functions[action] : functions.init;
if (!fn) {
throw new Error("Unknown function name '"+ action +"' for timeago");
}
// each over objects here and call the requested function
this.each(function() {
fn.call(this, options);
});
return this;
};
function refresh() {
var $s = $t.settings;
//check if it's still visible
if ($s.autoDispose && !$.contains(document.documentElement,this)) {
//stop if it has been removed
$(this).timeago("dispose");
return this;
}
var data = prepareData(this);
if (!isNaN(data.datetime)) {
if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
$(this).text(inWords(data.datetime));
} else {
if ($(this).attr('title').length > 0) {
$(this).text($(this).attr('title'));
}
}
}
return this;
}
function prepareData(element) {
element = $(element);
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if ($t.settings.localeTitle) {
element.attr("title", element.data('timeago').datetime.toLocaleString());
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
element.attr("title", text);
}
}
return element.data("timeago");
}
function inWords(date) {
return $t.inWords(distance(date));
}
function distance(date) {
return (new Date().getTime() - date.getTime());
}
// fix for IE6 suckage
document.createElement("abbr");
document.createElement("time");
}));

View File

@ -87,7 +87,7 @@ class Compiler extends Infusion
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml';
$componentXML = JFile::read($xmlPath);
$componentXML = file_get_contents($xmlPath);
$textToSite = ComponentbuilderHelper::getBetween($componentXML,'<files folder="site">','</files>');
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML,'<languages folder="site">','</languages>');
$componentXML = str_replace(array('<files folder="site">'.$textToSite."</files>", '<languages folder="site">'.$textToSiteLang."</languages>"), array('',''), $componentXML);
@ -107,6 +107,8 @@ class Compiler extends Infusion
$this->setLangFileData();
// move the update server into place
$this->setUpdateServer();
// set the global counters
$this->setCountingStuff();
// build read me
$this->buildReadMe();
// zip the component
@ -134,7 +136,7 @@ class Compiler extends Infusion
*/
private function setLine($nr)
{
if ($this->loadLineNr)
if ($this->debugLinenr)
{
return ' [Compiler '.$nr.']';
}
@ -150,29 +152,21 @@ class Compiler extends Infusion
protected function updateFiles()
{
if (isset($this->newFiles['static']) && ComponentbuilderHelper::checkArray($this->newFiles['static']) && isset($this->newFiles['dynamic']) && ComponentbuilderHelper::checkArray($this->newFiles['dynamic']))
{
// we don't update lang now since we will still posible add custom code
$langCheck = 'en-GB.com_'.$this->fileContentStatic['###component###'].'.';
{
// get the bom file
$bom = JFile::read($this->bomPath);
$bom = file_get_contents($this->bomPath);
// first we do the static files
foreach ($this->newFiles['static'] as $static)
{
if (JFile::exists($static['path']))
{
// skip lang files and store for later
if (strpos($static['path'], $langCheck))
{
$this->langFiles[] = $static;
continue;
}
$this->fileContentStatic['###FILENAME###'] = $static['name'];
$php = '';
if (ComponentbuilderHelper::checkFileType($static['name'],'php'))
{
$php = "<?php\n";
}
$string = JFile::read($static['path']);
$string = file_get_contents($static['path']);
if (strpos($string,'###BOM###') !== false)
{
list($wast,$code) = explode('###BOM###',$string);
@ -209,7 +203,7 @@ class Compiler extends Infusion
{
$php = "<?php\n";
}
$string = JFile::read($file['path']);
$string = file_get_contents($file['path']);
if (strpos($string,'###BOM###') !== false)
{
list($bin,$code) = explode('###BOM###',$string);
@ -302,6 +296,38 @@ class Compiler extends Infusion
$this->fileContentStatic['###BUILDDATE###'] = $this->fileContentStatic['###BUILDDATE###GLOBAL'];
$this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL'];
}
// set all global numbers
protected function setCountingStuff()
{
// what is the size in terms of an A4 book
$this->pageCount = round($this->lineCount / 56);
// setup the unrealistic numbers
$this->folderSeconds = $this->folderCount * 5;
$this->fileSeconds = $this->fileCount * 5;
$this->lineSeconds = $this->lineCount * 10;
$this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds;
$this->totalHours = round($this->seconds / 3600);
$this->totalDays = round($this->totalHours / 8);
// setup the more realistic numbers
$this->secondsDebugging = $this->seconds / 4;
$this->secondsPlanning = $this->seconds / 7;
$this->secondsMapping = $this->seconds / 10;
$this->secondsOffice = $this->seconds / 6;
$this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice;
$this->actualTotalHours = round($this->actualSeconds / 3600);
$this->actualTotalDays = round($this->actualTotalHours / 8);
$this->debuggingHours = round($this->secondsDebugging / 3600);
$this->planningHours = round($this->secondsPlanning / 3600);
$this->mappingHours = round($this->secondsMapping / 3600);
$this->officeHours = round($this->secondsOffice / 3600);
// the actual time spent
$this->actualHoursSpent = $this->actualTotalHours - $this->totalHours;
$this->actualDaysSpent = $this->actualTotalDays - $this->totalDays;
// calculate the projects actual time frame of completion
$this->projectWeekTime = round($this->actualTotalDays / 5,1);
$this->projectMonthTime = round($this->actualTotalDays / 24,1);
}
private function buildReadMe()
{
@ -330,7 +356,7 @@ class Compiler extends Infusion
$this->buildReadMeData();
}
// get the file
$string = JFile::read($path);
$string = file_get_contents($path);
// update the file
$answer = $this->setPlaceholders($string, $this->fileContentStatic);
// add to zip array
@ -339,55 +365,39 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// setup the unrealistic numbers
$folders = $this->folderCount * 5;
$files = $this->fileCount * 5;
$lines = $this->lineCount * 10;
$seconds = $folders + $files + $lines;
$totalHours = round($seconds / 3600);
$totalDays = round($totalHours / 8);
// setup the more realistic numbers
$debugging = $seconds / 4;
$planning = $seconds / 7;
$mapping = $seconds / 10;
$office = $seconds / 6;
$seconds = $folders + $files + $lines + $debugging + $planning + $mapping + $office;
$actualTotalHours = round($seconds / 3600);
$actualTotalDays = round($actualTotalHours / 8);
$debuggingHours = round($debugging / 3600);
$planningHours = round($planning / 3600);
$mappingHours = round($mapping / 3600);
$officeHours = round($office / 3600);
// the actual time spent
$actualHoursSpent = $actualTotalHours - $totalHours;
$actualDaysSpent = $actualTotalDays - $totalDays;
// calculate the projects actual time frame of completion
$projectWeekTime = round($actualTotalDays / 5,1);
$projectMonthTime = round($actualTotalDays / 24,1);
// set some defaults
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
$this->fileContentStatic['###folders###'] = $folders;
$this->fileContentStatic['###files###'] = $files;
$this->fileContentStatic['###lines###'] = $lines;
$this->fileContentStatic['###seconds###'] = $seconds;
$this->fileContentStatic['###totalHours###'] = $totalHours;
$this->fileContentStatic['###totalDays###'] = $totalDays;
$this->fileContentStatic['###debugging###'] = $debugging;
$this->fileContentStatic['###planning###'] = $planning;
$this->fileContentStatic['###mapping###'] = $mapping;
$this->fileContentStatic['###office###'] = $office;
$this->fileContentStatic['###actualTotalHours###'] = $actualTotalHours;
$this->fileContentStatic['###actualTotalDays###'] = $actualTotalDays;
$this->fileContentStatic['###debuggingHours###'] = $debuggingHours;
$this->fileContentStatic['###planningHours###'] = $planningHours;
$this->fileContentStatic['###mappingHours###'] = $mappingHours;
$this->fileContentStatic['###officeHours###'] = $officeHours;
$this->fileContentStatic['###actualHoursSpent###'] = $actualHoursSpent;
$this->fileContentStatic['###actualDaysSpent###'] = $actualDaysSpent;
$this->fileContentStatic['###projectWeekTime###'] = $projectWeekTime;
$this->fileContentStatic['###projectMonthTime###'] = $projectMonthTime;
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
$this->fileContentStatic['###files###'] = $this->fileSeconds;
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
$this->fileContentStatic['###office###'] = $this->secondsOffice;
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
}
private function zipComponent()
@ -404,39 +414,9 @@ class Compiler extends Infusion
}
// the name of the zip file to create
$this->filepath = $this->tempPath.'/'.$this->componentFolderName.'.zip';
// store the current joomla working directory
$joomla = getcwd();
// we are changing the working directory to the componet temp folder
chdir($this->componentPath);
// the full file path of the zip file
$this->filepath = JPath::clean($this->filepath);
// delete an existing zip file (or use an exclusion parameter in JFolder::files()
JFile::delete($this->filepath);
// get a list of files in the current directory tree
$files = JFolder::files('.', '', true, true);
$zipArray = array();
// setup the zip array
foreach ($files as $file)
{
$tmp = array();
$tmp['name'] = str_replace('./', '', $file);
$tmp['data'] = JFile::read($file);
$tmp['time'] = filemtime($file);
$zipArray[] = $tmp;
}
// change back to joomla working directory
chdir($joomla);
// get the zip adapter
$zip = JArchive::getAdapter('zip');
//create the zip file
if ($zip->create($this->filepath, $zipArray))
if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath))
{
// now move to backup if zip was made and backup is requered
if ($this->backupPath && $this->dynamicIntegration)

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,13 @@ class Structure extends Get
*/
public $fileCount = 0;
/**
* The page counter
*
* @var int
*/
public $pageCount = 0;
/**
* The line counter
*
@ -52,6 +59,153 @@ class Structure extends Get
*/
public $lineCount = 0;
/**
* The seconds counter
*
* @var int
*/
public $seconds = 0;
/**
* The actual seconds counter
*
* @var int
*/
public $actualSeconds = 0;
/**
* The folder seconds counter
*
* @var int
*/
public $folderSeconds = 0;
/**
* The file seconds counter
*
* @var int
*/
public $fileSeconds = 0;
/**
* The line seconds counter
*
* @var int
*/
public $lineSeconds = 0;
/**
* The seconds debugging counter
*
* @var int
*/
public $secondsDebugging = 0;
/**
* The seconds planning counter
*
* @var int
*/
public $secondsPlanning = 0;
/**
* The seconds mapping counter
*
* @var int
*/
public $secondsMapping = 0;
/**
* The seconds office counter
*
* @var int
*/
public $secondsOffice = 0;
/**
* The total hours counter
*
* @var int
*/
public $totalHours = 0;
/**
* The debugging hours counter
*
* @var int
*/
public $debuggingHours = 0;
/**
* The planning hours counter
*
* @var int
*/
public $planningHours = 0;
/**
* The mapping hours counter
*
* @var int
*/
public $mappingHours = 0;
/**
* The office hours counter
*
* @var int
*/
public $officeHours = 0;
/**
* The actual Total Hours counter
*
* @var int
*/
public $actualTotalHours = 0;
/**
* The actual hours spent counter
*
* @var int
*/
public $actualHoursSpent = 0;
/**
* The actual days spent counter
*
* @var int
*/
public $actualDaysSpent = 0;
/**
* The total days counter
*
* @var int
*/
public $totalDays = 0;
/**
* The actual Total Days counter
*
* @var int
*/
public $actualTotalDays = 0;
/**
* The project week time counter
*
* @var int
*/
public $projectWeekTime = 0;
/**
* The project month time counter
*
* @var int
*/
public $projectMonthTime = 0;
/**
* The Joomla Version
*
@ -205,7 +359,7 @@ class Structure extends Get
*/
private function setLine($nr)
{
if ($this->loadLineNr)
if ($this->debugLinenr)
{
return ' [Structure '.$nr.']';
}
@ -567,16 +721,19 @@ class Structure extends Get
*/
public function getLastModifiedDate($view)
{
if (isset($view['settings']->modified) && ComponentbuilderHelper::checkString($view['settings']->modified))
// first set the main date
if (isset($view['settings']->modified)
&& ComponentbuilderHelper::checkString($view['settings']->modified)
&& '0000-00-00 00:00:00' !== $view['settings']->modified)
{
// first set the main date
$date = strtotime($view['settings']->modified);
}
else
{
// first set the main date
// use todays date
$date = strtotime("now");
}
// search for the last modified date
if (isset($view['adminview']))
{
$id = $view['adminview'].'admin';
@ -587,7 +744,9 @@ class Structure extends Get
{
foreach ($view['settings']->fields as $field)
{
if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']) && isset($field['settings']->modified))
if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings'])
&& isset($field['settings']->modified) && ComponentbuilderHelper::checkString($field['settings']->modified)
&& '0000-00-00 00:00:00' !== $field['settings']->modified)
{
$anotherDate = strtotime($field['settings']->modified);
if ($anotherDate > $date)
@ -605,7 +764,9 @@ class Structure extends Get
// now check if value has been set
if (!isset($this->lastModifiedDate[$id]))
{
if (isset($view['settings']->main_get->modified))
if (isset($view['settings']->main_get->modified)
&& ComponentbuilderHelper::checkString($view['settings']->main_get->modified)
&& '0000-00-00 00:00:00' !== $view['settings']->main_get->modified)
{
$anotherDate = strtotime($view['settings']->main_get->modified);
if ($anotherDate > $date)
@ -621,7 +782,9 @@ class Structure extends Get
// now check if value has been set
if (!isset($this->lastModifiedDate[$id]))
{
if (isset($view['settings']->main_get->modified))
if (isset($view['settings']->main_get->modified)
&& ComponentbuilderHelper::checkString($view['settings']->main_get->modified)
&& '0000-00-00 00:00:00' !== $view['settings']->main_get->modified)
{
$anotherDate = strtotime($view['settings']->main_get->modified);
if ($anotherDate > $date)
@ -939,34 +1102,11 @@ class Structure extends Get
* @param string $dir The path to folder to remove
* @param boolean $git if there is a git folder in that must not be removed
*
* @return boolean True in all is removed
* @return boolean True if all is removed
*
*/
protected function removeFolder($dir, $git = false)
{
if (JFolder::exists($dir))
{
$it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($it as $file)
{
if ('.' === $file->getBasename() || '..' === $file->getBasename()) continue;
if ($file->isDir())
{
if ($git && strpos($file->getPathname(), $dir.'/.git') !== false) continue;
JFolder::delete($file->getPathname());
}
else
{
if ($git && strpos($file->getPathname(), $dir.'/.git') !== false) continue;
JFile::delete($file->getPathname());
}
}
if (!$git && JFolder::delete($dir))
{
return true;
}
}
return false;
return ComponentbuilderHelper::removeFolder($dir, $git);
}
}

View File

@ -61,6 +61,13 @@ class Fields extends Structure
*/
public $layoutBuilder = array();
/**
* used to fix the zero order
*
* @var array
*/
private $zeroOrderFix = array();
/**
* Site field data
*
@ -229,6 +236,13 @@ class Fields extends Structure
*/
public $jsonStringBuilder = array();
/**
* Json String Builder for return values to array
*
* @var array
*/
public $jsonItemBuilderArray = array();
/**
* Json Item Builder
*
@ -311,7 +325,14 @@ class Fields extends Structure
*
* @var array
*/
public $fieldsNames = array();
public $fieldsNames = array();
/**
* Set unique Names
*
* @var array
*/
public $uniqueNames = array();
/**
* Default Fields
@ -344,7 +365,7 @@ class Fields extends Structure
*/
private function setLine($nr)
{
if ($this->loadLineNr)
if ($this->debugLinenr)
{
return ' [Fields '.$nr.']';
}
@ -368,6 +389,19 @@ class Fields extends Structure
// setup the list view and single view name
$listViewName = ComponentbuilderHelper::safeString($view['settings']->name_list);
$viewName = ComponentbuilderHelper::safeString($view['settings']->name_single);
// set some place holder for this view
$this->placeholders['###view###'] = $viewName;
$this->placeholders['###VIEW###'] = strtoupper($viewName);
$this->placeholders['###View###'] = ucfirst($viewName);
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['###views###'] = $listViewName;
$this->placeholders['###VIEWS###'] = strtoupper($listViewName);
$this->placeholders['###Views###'] = ucfirst($listViewName);
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
// add metadata to the view
if ($view['metadata'])
{
@ -385,12 +419,12 @@ class Fields extends Structure
$readOnly = "\t\t\t" . 'readonly="true"' . PHP_EOL."\t\t\t" . 'disabled="true"';
}
// main lang prefix
$langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'U');
$langViews = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_list, 'U');
$langView = $this->langPrefix . '_' . $this->placeholders['###VIEW###'];
$langViews = $this->langPrefix . '_' . $this->placeholders['###VIEWS###'];
// set default lang
$this->langContent[$this->lang][$langView] = $view['settings']->name_single;
$this->langContent[$this->lang][$langViews] = $view['settings']->name_list;
// set the singel name
// set the single name
$viewSingleName = ComponentbuilderHelper::safeString($view['settings']->name_single, 'W');
// set global item strings
$this->langContent[$this->lang][$langViews . '_N_ITEMS_ARCHIVED'] = "%s " . $view['settings']->name_list . " archived.";
@ -427,22 +461,22 @@ class Fields extends Structure
$this->langContent[$this->lang][$langView . '_VERSION_DESC'] = "A count of the number of times this " . $view['settings']->name_single . " has been revised.";
$this->langContent[$this->lang][$langView . '_SAVE_WARNING'] = "Alias already existed so a number was added at the end. You can re-edit the " . $view['settings']->name_single . " to customise the alias.";
// check if the same field is added multiple times
foreach ($view['settings']->fields as $field)
{
$name = ComponentbuilderHelper::safeString($field['settings']->name);
$this->setUniqueNameKeeper($field, $view['settings']->type, $name, $viewName);
}
// start adding dynamc fields
$dynamcfields = '';
// place holders
$placeholders = array(
'###component###' => $component,
'###view###' => $viewName,
'###views###' => $listViewName);
$spacerCounter = 'a';
// set the custom table key
$dbkey = 'g';
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamcfields .= $this->setDynamicField($field, $view, $view['settings']->type, $langView, $viewName, $listViewName, $spacerCounter, $placeholders, $dbkey, true);
$dynamcfields .= $this->setDynamicField($field, $view, $view['settings']->type, $langView, $viewName, $listViewName, $spacerCounter, $this->placeholders, $dbkey, true);
}
// set the defautl fields
$fieldSet = array();
$fieldSet[] = '<fieldset name="details">';
@ -633,6 +667,8 @@ class Fields extends Structure
$fieldSet[] = "\t\t</fieldset>";
$fieldSet[] = "\t</fields>";
}
// just to be safe, lets clear the view placeholders
$this->clearFromPlaceHolders('view');
// retunr the set
return implode(PHP_EOL, $fieldSet);
}
@ -738,8 +774,8 @@ class Fields extends Structure
}
elseif ($this->defaultField($typeName, 'special'))
{
// set the repeatable field
if ($typeName === 'repeatable')
// set the repeatable field or subform field
if ($typeName === 'repeatable' || $typeName === 'subform')
{
if ($build)
{
@ -934,12 +970,12 @@ class Fields extends Structure
if (strpos($fieldAttributes['fields'], ',') !== false)
{
// mulitpal fields
$fieldsSets = explode(',', $fieldAttributes['fields']);
$fieldsSets = (array) explode(',', $fieldAttributes['fields']);
}
else
elseif (is_numeric($fieldAttributes['fields']))
{
// single field
$fieldsSets[] = $fieldAttributes['fields'];
$fieldsSets[] = (int) $fieldAttributes['fields'];
}
// only continue if we have a field set
if (ComponentbuilderHelper::checkArray($fieldsSets))
@ -1003,6 +1039,93 @@ class Fields extends Structure
$fieldSet .= PHP_EOL."\t\t\t</fields>";
$fieldSet .= PHP_EOL."\t\t</field>";
}
// set the subform fields (it is a repeatable without the modal)
elseif ($typeName === 'subform')
{
// now add to the field set
$fieldSet .= PHP_EOL."\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= PHP_EOL."\t\t<field";
$fieldsSet = array();
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'fields')
{
$fieldSet .= PHP_EOL."\t\t\t" . $property . '="' . $value . '"';
}
}
$fieldSet .= ">";
$fieldSet .= PHP_EOL."\t\t\t" . '<form hidden="true" name="list_' . $fieldAttributes['name'] . '_modal" repeat="true">';
if (strpos($fieldAttributes['fields'], ',') !== false)
{
// mulitpal fields
$fieldsSets = (array) explode(',', $fieldAttributes['fields']);
}
elseif (is_numeric($fieldAttributes['fields']))
{
// single field
$fieldsSets[] = (int) $fieldAttributes['fields'];
}
// only continue if we have a field set
if (ComponentbuilderHelper::checkArray($fieldsSets))
{
foreach ($fieldsSets as $fieldId)
{
// get the field data
$fieldData = array();
$fieldData['settings'] = $this->getFieldData($fieldId, $viewName);
if (ComponentbuilderHelper::checkObject($fieldData['settings']))
{
$r_name = ComponentbuilderHelper::safeString($fieldData['settings']->name);
$r_typeName = ComponentbuilderHelper::safeString($fieldData['settings']->type_name);
$r_multiple = false;
$r_langLabel = '';
// add the tabs needed
$taber = "\t\t";
// get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $spacerCounter, $listViewName, $viewName, $placeholders, true);
// check if values were set
if (ComponentbuilderHelper::checkArray($r_fieldValues))
{
//reset options array
$r_optionArray = array();
if ($this->defaultField($r_typeName, 'option'))
{
// now add to the field set
$fieldSet .= $this->setField('option', $taber, $r_fieldValues, $r_name, $r_typeName, $langView, $viewName, $listViewName, $placeholders, $r_optionArray);
}
elseif ($this->defaultField($r_typeName, 'plain'))
{
// now add to the field set
$fieldSet .= $this->setField('plain', $taber, $r_fieldValues, $r_name, $r_typeName, $langView, $viewName, $listViewName, $placeholders, $r_optionArray);
}
elseif (ComponentbuilderHelper::checkArray($r_fieldValues['custom']))
{
// add to custom
$custom = $r_fieldValues['custom'];
unset($r_fieldValues['custom']);
// now add to the field set
$fieldSet .= $this->setField('custom', $taber, $r_fieldValues, $r_name, $r_typeName, $langView, $viewName, $listViewName, $placeholders, $r_optionArray);
// set lang (just incase)
$r_listLangName = $langView . '_' . ComponentbuilderHelper::safeString($r_name, 'U');
// add to lang array
$this->langContent[$this->lang][$r_listLangName] = ComponentbuilderHelper::safeString($r_name, 'W');
// if label was set use instead
if (ComponentbuilderHelper::checkString($r_langLabel))
{
$r_listLangName = $r_langLabel;
}
// set the custom array
$data = array('type' => $r_typeName, 'code' => $r_name, 'lang' => $r_listLangName, 'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile($data, $listViewName, $viewName);
}
}
}
}
}
$fieldSet .= PHP_EOL."\t\t\t</form>";
$fieldSet .= PHP_EOL."\t\t</field>";
}
}
elseif ($setType === 'custom')
{
@ -1044,6 +1167,26 @@ class Fields extends Structure
*/
public function setLayoutBuilder(&$viewName,&$tabName,&$name,&$field)
{
// first fix the zero order
// to insure it lands before all the other fields
// as zero is expected to behave
if ($field['order_edit'] == 0)
{
if (!isset($this->zeroOrderFix[$viewName]))
{
$this->zeroOrderFix[$viewName] = array();
}
if (!isset($this->zeroOrderFix[$viewName][(int) $field['tab']]))
{
$this->zeroOrderFix[$viewName][(int) $field['tab']] = -999;
}
else
{
$this->zeroOrderFix[$viewName][(int) $field['tab']]++;
}
$field['order_edit'] = $this->zeroOrderFix[$viewName][(int) $field['tab']];
}
// now build the layout
if (ComponentbuilderHelper::checkString($tabName) && $tabName != 'publishing')
{
$this->tabCounter[$viewName][(int) $field['tab']] = $tabName;
@ -1135,18 +1278,18 @@ class Fields extends Structure
/**
* set field attributes
*
* @param array $field The field data
* @param int $viewType The view type
* @param string $name The field name
* @param string $typeName The field type
* @param boolean $multiple The switch to set multiple selection option
* @param string $langLabel The language string for field label
* @param string $langView The language string of the view
* @param array $field The field data
* @param int $viewType The view type
* @param string $name The field name
* @param string $typeName The field type
* @param boolean $multiple The switch to set multiple selection option
* @param string $langLabel The language string for field label
* @param string $langView The language string of the view
* @param string $spacerCounter The space counter value
* @param string $listViewName The list view name
* @param string $viewName The singel view name
* @param array $placeholders The place holder and replace values
* @param boolean $repeatable The repeatable field switch
* @param string $listViewName The list view name
* @param string $viewName The singel view name
* @param array $placeholders The place holder and replace values
* @param boolean $repeatable The repeatable field switch
*
* @return array The field attributes
*
@ -1219,7 +1362,7 @@ class Fields extends Structure
{
// quick check if this is a category linked to view page
$requeSt_id = ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"');
if (strpos($requeSt_id, '_request_id') !== false)
if (strpos($requeSt_id, '_request_id') !== false || strpos($requeSt_id, '_request_catid') !== false)
{
// keep it then, don't change
$xmlValue = $requeSt_id;
@ -1264,12 +1407,16 @@ class Fields extends Structure
// use field core name only if not found in xml
if (!ComponentbuilderHelper::checkString($xmlValue))
{
// make sure the XML name is uniqe, so we can add one field multiple times
$name = $this->uniqueName($name, $viewName);
$xmlValue = $name;
}
// set the name if found
else
{
$name = $xmlValue;
// make sure the XML name is uniqe, so we can add one field multiple times
$xmlValue = $this->uniqueName($xmlValue, $viewName);
$name = $this->setPlaceholders($xmlValue, $placeholders);
}
}
elseif ($property['name'] === 'extension' || $property['name'] === 'directory')
@ -1381,6 +1528,14 @@ class Fields extends Structure
// check if translatable
if (ComponentbuilderHelper::checkString($xmlValue) && $property['translatable'] == 1)
{
// update lable if field use multiple times
if ($property['name'] === 'label')
{
if (isset($fieldAttributes['name']) && isset($this->uniqueNames[$viewName]['names'][$fieldAttributes['name']]))
{
$xmlValue .= ' (' . ComponentbuilderHelper::safeString($this->uniqueNames[$viewName]['names'][$fieldAttributes['name']]) . ')';
}
}
// replace placeholders
$xmlValue = $this->setPlaceholders($xmlValue, $placeholders);
// insure custom lables dont get messed up
@ -1432,18 +1587,17 @@ class Fields extends Structure
$xmlValue = $property['example'];
}
}
$fieldAttributes[$property['name']] = $xmlValue;
// load to langBuilder down the line
if ($property['name'] === 'label')
{
$langLabel = $xmlValue;
if ($setCustom)
{
$fieldAttributes['custom']['label'] = $customLabel;
}
$langLabel = $xmlValue;
}
// now set the value
$fieldAttributes[$property['name']] = $xmlValue;
}
}
// do some nice twigs beyond the default
@ -1455,11 +1609,134 @@ class Fields extends Structure
{
$this->doNotEscape[$listViewName][] = $fieldAttributes['name'];
}
// check if we have display switch for dynamic placment
$display = ComponentbuilderHelper::getBetween($field['settings']->xml, 'display="', '"');
if (ComponentbuilderHelper::checkString($display))
{
$fieldAttributes['display'] = $display;
}
}
}
return $fieldAttributes;
}
/**
* Keep track of the field names, to see if it used multiple times
*
* @param array $field The field data
* @param string $typeName The field type
* @param string $name The field name
* @param string $viewName The singel view name
*
* @return void
*
*/
protected function setUniqueNameKeeper(&$field, &$typeName, &$name, $viewName)
{
// setup a default field
if (ComponentbuilderHelper::checkArray($field['settings']->properties))
{
foreach ($field['settings']->properties as $property)
{
// reset
$xmlValue = '';
if ($property['name'] === 'name')
{
// if category then name must be catid (only one per view)
if ($typeName === 'category')
{
// only one allowed
return;
}
// if tag is set then enable all tag options for this view (only one per view)
elseif ($typeName === 'tag')
{
// only one allowed
return;
}
// if the field is set as alias it must be called alias
elseif (isset($field['alias']) && $field['alias'])
{
// only one allowed
return;
}
elseif ($typeName === 'spacer')
{
// not needed here
return;
}
else
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'));
}
// use field core name only if not found in xml
if (!ComponentbuilderHelper::checkString($xmlValue))
{
$xmlValue = $name;
}
// make sure the XML name is uniqe, so we can add one field multiple times
return $this->setUniqueNameCounter($xmlValue, $viewName);
}
}
}
}
/**
* Count how many times the same field is used per view
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return void
*
*/
protected function setUniqueNameCounter($name, $view)
{
if (!isset($this->uniqueNames[$view]))
{
$this->uniqueNames[$view] = array();
$this->uniqueNames[$view]['counter'] = array();
$this->uniqueNames[$view]['names'] = array();
}
if (!isset($this->uniqueNames[$view]['counter'][$name]))
{
$this->uniqueNames[$view]['counter'][$name] = 1;
return;
}
// count how many times the field is used
$this->uniqueNames[$view]['counter'][$name]++;
return;
}
/**
* Naming each field with an unique name
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return string the name
*
*/
protected function uniqueName($name, $view)
{
// only increment if the field name is used multiple times
if (isset($this->uniqueNames[$view]['counter'][$name]) && $this->uniqueNames[$view]['counter'][$name] > 1)
{
$counter = $this->uniqueNames[$view]['counter'][$name];
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
while (isset($this->uniqueNames[$view]['names'][$uniqueName]))
{
$counter--;
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
}
// set the new name
$this->uniqueNames[$view]['names'][$uniqueName] = $counter;
return $uniqueName;
}
return $name;
}
/**
* set Builders
@ -1519,6 +1796,8 @@ class Fields extends Structure
{
$this->queryBuilder[$viewName][$name]['default'] = 'EMPTY';
}
// to identify the field
$this->queryBuilder[$viewName][$name]['ID'] = $field['settings']->id;
$this->queryBuilder[$viewName][$name]['null_switch'] = $field['settings']->null_switch;
// set index types
if ($field['settings']->indexes == 1 && !in_array($field['settings']->datatype, $textKeys))
@ -1576,7 +1855,7 @@ class Fields extends Structure
}
}
// build the list values
if ($field['list'] == 1 && $typeName != 'repeatable')
if ($field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
{
// load to list builder
$this->listBuilder[$listViewName][] = array(
@ -1612,7 +1891,7 @@ class Fields extends Structure
$this->intFieldsBuilder[$viewName] .= ',"' . $name . '"';
}
// set all dynamic field of this view
if ($typeName != 'category' && $typeName != 'repeatable' && !in_array($name, $this->defaultFields))
if ($typeName != 'category' && $typeName != 'repeatable' && $typeName != 'subform' && !in_array($name, $this->defaultFields))
{
if (!isset($this->dynamicfieldsBuilder[$viewName]))
{
@ -1637,9 +1916,9 @@ class Fields extends Structure
}
}
// set the custom builder
if (ComponentbuilderHelper::checkArray($custom) && $typeName != 'category' && $typeName != 'repeatable')
if (ComponentbuilderHelper::checkArray($custom) && $typeName != 'category' && $typeName != 'repeatable' && $typeName != 'subform')
{
$this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom);
$this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'method' => $field['settings']->store);
// set the custom fields needed in content type data
if (!isset($this->customFieldLinksBuilder[$viewName]))
{
@ -1683,7 +1962,7 @@ class Fields extends Structure
$this->checkboxBuilder[$viewName][] = $name;
}
// setup checkboxes and other json items for this view
if (($typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && $typeName != 'tag')
if (($typeName === 'subform' || $typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && $typeName != 'tag')
{
switch ($field['settings']->store)
{
@ -1725,7 +2004,7 @@ class Fields extends Structure
}
// load the json list display fix
if ($field['list'] == 1 && $typeName != 'repeatable')
if ($field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
{
if (ComponentbuilderHelper::checkArray($options))
{
@ -1736,6 +2015,12 @@ class Fields extends Structure
$this->getItemsMethodListStringFixBuilder[$viewName][] = array('name' => $name, 'type' => $typeName, 'translation' => false, 'custom' => $custom, 'method' => $field['settings']->store);
}
}
// if subform the values must revert to array
if ('subform' === $typeName)
{
$this->jsonItemBuilderArray[$viewName][] = $name;
}
}
// build the data for the export & import methods $typeName === 'repeatable' ||
if (($typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && !ComponentbuilderHelper::checkArray($options))
@ -1746,12 +2031,12 @@ class Fields extends Structure
// check if field should be added to uikit
$this->buildSiteFieldData($viewName, $name, 'uikit', $typeName);
// load the selection translation fix
if (ComponentbuilderHelper::checkArray($options) && $field['list'] == 1 && $typeName != 'repeatable')
if (ComponentbuilderHelper::checkArray($options) && $field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
{
$this->selectionTranslationFixBuilder[$listViewName][$name] = $options;
}
// build the sort values
if ($field['sort'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable'))
if ($field['sort'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
{
$this->sortBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'options' => $options);
}
@ -1761,7 +2046,7 @@ class Fields extends Structure
$this->searchBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $field['list']);
}
// build the filter values
if ($field['filter'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable'))
if ($field['filter'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
{
$this->filterBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'database' => $viewName, 'function' => ComponentbuilderHelper::safeString($name, 'F'), 'custom' => $custom, 'options' => $options);
}
@ -1918,7 +2203,7 @@ class Fields extends Structure
'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file',
'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite',
'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password',
'plugins', 'radio', 'repeatable', 'range', 'rules', 'sessionhandler', 'spacer', 'sql', 'tag',
'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag',
'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag',
'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
),
@ -1939,7 +2224,7 @@ class Fields extends Structure
),
'special' => array(
'contentlanguage', 'groupedlist', 'moduleposition', 'plugin',
'repeatable', 'templatestyle'
'repeatable', 'templatestyle', 'subform'
)
);

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@ class Infusion extends Interpretation
*/
private function setLine($nr)
{
if ($this->loadLineNr)
if ($this->debugLinenr)
{
return ' [Infusion '.$nr.']';
}
@ -80,13 +80,13 @@ class Infusion extends Interpretation
if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views))
{
// ###COMPONENT###
$this->fileContentStatic['###COMPONENT###'] = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U');
$this->fileContentStatic['###COMPONENT###'] = $this->placeholders['###COMPONENT###'];
// ###Component###
$this->fileContentStatic['###Component###'] = ComponentbuilderHelper::safeString($this->componentData->name_code, 'F');
$this->fileContentStatic['###Component###'] = $this->placeholders['###Component###'];
// ###component###
$this->fileContentStatic['###component###'] = ComponentbuilderHelper::safeString($this->componentData->name_code);
$this->fileContentStatic['###component###'] = $this->placeholders['###component###'];
// ###COMPANYNAME###
$this->fileContentStatic['###COMPANYNAME###'] = trim(JFilterOutput::cleanText($this->componentData->companyname));
@ -132,20 +132,13 @@ class Infusion extends Interpretation
// ###ACCESS_SECTIONS###
$this->fileContentStatic['###ACCESS_SECTIONS###'] = $this->setAccessSections();
// set component place holders
$this->placeholders = array(
'###Component###' => $this->fileContentStatic['###Component###'],
'###component###' => $this->fileContentStatic['###component###'],
'###COMPONENT###' => $this->fileContentStatic['###COMPONENT###'],
'[[[Component]]]' => $this->fileContentStatic['###Component###'],
'[[[component]]]' => $this->fileContentStatic['###component###'],
'[[[COMPONENT]]]' => $this->fileContentStatic['###COMPONENT###']
);
// ###CONFIG_FIELDSETS###
$keepLang = $this->lang;
$this->lang = 'admin';
// start loading the category tree scripts
$this->fileContentStatic['###CATEGORY_CLASS_TREES###'] = '';
// run the field sets for first time
$this->setConfigFieldsets(1);
$this->lang = $keepLang;
@ -156,10 +149,12 @@ class Infusion extends Interpretation
$this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders);
// ###CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###']
= $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
// ###BOTH_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###']
= $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
// ###ADMIN_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = '';
@ -175,14 +170,16 @@ class Infusion extends Interpretation
{
// ###ADMIN_GLOBAL_EVENT###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Admin Event';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###']
.= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
// ###ADMIN_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Admin Event Method.';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###']
.= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
@ -199,8 +196,6 @@ class Infusion extends Interpretation
$this->fileContentStatic['###HELP###'] = $this->noHelp();
// ###HELP_SITE###
$this->fileContentStatic['###HELP_SITE###'] = $this->noHelp();
// ###UPDATE_VERSION_MYSQL###
$this->setVersionController();
// build route parse switch
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] = '';
@ -216,6 +211,9 @@ class Infusion extends Interpretation
// start dynamic build
foreach ($this->componentData->admin_views as $view)
{
// just to be safe, lets clear the view placeholders
$this->clearFromPlaceHolders('view');
// set the target
$this->target = 'admin';
$this->lang = 'admin';
// set main keys
@ -253,18 +251,19 @@ class Infusion extends Interpretation
// set some place holder for the views
$this->placeholders['###view###'] = $viewName_single;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['###View###'] = $viewName_f;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['[[[view]]]'] = $viewName_single;
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
$this->placeholders['[[[View]]]'] = $viewName_f;
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
// set license per view if needed
$this->setLockLicensePer($viewName_single, $this->target);
$this->setLockLicensePer($viewName_list, $this->target);
// ###FIELDSETS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###']);
$this->fileContentDynamic[$viewName_single]['###FIELDSETS###']
= $this->setFieldSet($view, $this->fileContentStatic['###component###']);
// ###ACCESSCONTROL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single);
@ -287,11 +286,14 @@ class Infusion extends Interpretation
// ###AJAXTOKE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single);
if (isset($this->customScriptBuilder['php_document'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['php_document'][$viewName_single]))
if (isset($this->customScriptBuilder['php_document'][$viewName_single])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder['php_document'][$viewName_single]))
{
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###']
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['php_document'][$viewName_single], $this->placeholders);
= PHP_EOL.$this->setPlaceholders(
$this->customScriptBuilder['php_document'][$viewName_single],
$this->placeholders);
// clear some memory
unset($this->customScriptBuilder['php_document'][$viewName_single]);
}
@ -304,7 +306,8 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = '';
// ###VALIDATEFIX### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###'] = $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']);
$this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###']
= $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']);
// ###EDITBODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###EDITBODY###'] = $this->setEditBody($view);
@ -328,16 +331,20 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = '';
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###']
= $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL);
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL.PHP_EOL);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###']
= $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL.PHP_EOL);
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###']
= $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL);
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL.PHP_EOL);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###']
= $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL.PHP_EOL);
// ###CHECKBOX_SAVE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single);
@ -346,9 +353,12 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single);
// ###POSTSAVEHOOK### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL."\t\treturn;", PHP_EOL.PHP_EOL."\t\treturn;");
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###']
= $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true,
PHP_EOL."\t\treturn;", PHP_EOL.PHP_EOL."\t\treturn;");
if (isset($this->customScriptBuilder['css_view'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single]))
if (isset($this->customScriptBuilder['css_view'][$viewName_single])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single]))
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###']
@ -364,7 +374,8 @@ class Infusion extends Interpretation
// add css to front end
if ($view['edit_create_site_view'])
{
$this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###'] = $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'];
$this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###']
= $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'];
}
}
// set the views names
@ -389,11 +400,11 @@ class Infusion extends Interpretation
// set some place holder for the views
$this->placeholders['###views###'] = $viewName_list;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['###Views###'] = $viewsName_f;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['[[[views]]]'] = $viewName_list;
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
$this->placeholders['[[[Views]]]'] = $viewsName_f;
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
// set the export/import option
if ($view['port'])
@ -415,9 +426,11 @@ class Infusion extends Interpretation
if ($view['checkin'] == 1)
{
// ###AUTOCHECKIN### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = $this->setAutoCheckin($viewName_single,$this->fileContentStatic['###component###']);
$this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###']
= $this->setAutoCheckin($viewName_single,$this->fileContentStatic['###component###']);
// ###CHECKINCALL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = $this->setCheckinCall();
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###']
= $this->setCheckinCall();
}
else
{
@ -427,19 +440,26 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = '';
}
// ###ADMIN_CUSTOM_BUTTONS_LIST###
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] = $this->setCustomButtons($view, 3, "\t");
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###']
= $this->setCustomButtons($view, 3, "\t");
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST###']
= $this->setFunctionOnlyButtons($viewName_list);
// ###GET_ITEMS_METHOD_STRING_FIX### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###']);
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###']
= $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###']);
// ###GET_ITEMS_METHOD_AFTER_ALL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###']
= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
// ###SELECTIONTRANSLATIONFIX### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] = $this->setSelectionTranslationFix($viewName_list,$this->fileContentStatic['###Component###']);
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###']
= $this->setSelectionTranslationFix($viewName_list,$this->fileContentStatic['###Component###']);
// ###SELECTIONTRANSLATIONFIXFUNC### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###'] = $this->setSelectionTranslationFixFunc($viewName_list,$this->fileContentStatic['###Component###']);
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###']
= $this->setSelectionTranslationFixFunc($viewName_list,$this->fileContentStatic['###Component###']);
// ###FILTER_FIELDS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###FILTER_FIELDS###'] = $this->setFilterFields($viewName_list);
@ -461,28 +481,34 @@ class Infusion extends Interpretation
{
$this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] = '';
}
$this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] .= $this->setRouterCategoryViews($viewName_single,$viewName_list);
$this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###']
.= $this->setRouterCategoryViews($viewName_single,$viewName_list);
// ###OTHERFILTERS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###OTHERFILTERS###'] = $this->setOtherFilter($viewName_list);
// ###FILTERFUNCTIONS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###'] = $this->setFilterFunctions($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###']
= $this->setFilterFunctions($viewName_single,$viewName_list);
// ###LISTQUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###LISTQUERY###'] = $this->setListQuery($viewName_single,$viewName_list);
// ###MODELEXPORTMETHOD### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###'] = $this->setModelExportMethod($viewName_single, $viewName_list);
$this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###']
= $this->setModelExportMethod($viewName_single, $viewName_list);
// ###MODELEXIMPORTMETHOD### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###'] = $this->setControllerEximportMethod($viewName_single, $viewName_list);
$this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###']
= $this->setControllerEximportMethod($viewName_single, $viewName_list);
// ###EXPORTBUTTON### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###'] = $this->setExportButton($viewName_single, $viewName_list);
$this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###']
= $this->setExportButton($viewName_single, $viewName_list);
// ###IMPORTBUTTON### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###'] = $this->setImportButton($viewName_single, $viewName_list);
$this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###']
= $this->setImportButton($viewName_single, $viewName_list);
// ###LISTHEAD### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###LISTHEAD###'] = $this->setListHead($viewName_single,$viewName_list);
@ -494,9 +520,11 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list]['###LISTCOLNR###'] = $this->setListColnr($viewName_list);
// ###JVIEWLISTCANDO### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] = $this->setJviewListCanDo($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###']
= $this->setJviewListCanDo($viewName_single,$viewName_list);
if (isset($this->customScriptBuilder['css_views'][$viewName_list]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_views'][$viewName_list]))
if (isset($this->customScriptBuilder['css_views'][$viewName_list])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder['css_views'][$viewName_list]))
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###']
@ -530,28 +558,36 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list]['###BATCH_ONCLICK_CANCEL_SCRIPT###'] = ''; // TODO <-- must still be build
// ###JCONTROLLERFORM_ALLOWADD### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###'] = $this->setJcontrollerAllowAdd($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###']
= $this->setJcontrollerAllowAdd($viewName_single,$viewName_list);
// ###JCONTROLLERFORM_ALLOWEDIT### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###'] = $this->setJcontrollerAllowEdit($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###']
= $this->setJcontrollerAllowEdit($viewName_single,$viewName_list);
// ###JMODELADMIN_GETFORM### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###'] = $this->setJmodelAdminGetForm($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###']
= $this->setJmodelAdminGetForm($viewName_single,$viewName_list);
// ###JMODELADMIN_ALLOWEDIT### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###'] = $this->setJmodelAdminAllowEdit($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###']
= $this->setJmodelAdminAllowEdit($viewName_single,$viewName_list);
// ###JMODELADMIN_CANDELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###'] = $this->setJmodelAdminCanDelete($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###']
= $this->setJmodelAdminCanDelete($viewName_single,$viewName_list);
// ###JMODELADMIN_CANEDITSTATE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###'] = $this->setJmodelAdminCanEditState($viewName_single,$viewName_list);
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###']
= $this->setJmodelAdminCanEditState($viewName_single,$viewName_list);
// set custom admin view Toolbare buttons
// ###CUSTOM_ADMIN_DYNAMIC_BUTTONS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###'] = $this->setCustomAdminDynamicButton($viewName_list);
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###']
= $this->setCustomAdminDynamicButton($viewName_list);
// ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###'] = $this->setCustomAdminDynamicButtonController($viewName_list);
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###']
= $this->setCustomAdminDynamicButtonController($viewName_list);
// set helper router
if (!isset($this->fileContentStatic['###ROUTEHELPER###']))
@ -603,7 +639,8 @@ class Infusion extends Interpretation
}
if (!isset($this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC']))
{
$this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'] = $view['settings']->description;
$this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC']
= $view['settings']->description;
}
// ###ICOMOON### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###ICOMOON###'] = $view['icomoon'];
@ -628,7 +665,8 @@ class Infusion extends Interpretation
if ($view['settings']->main_get->gettype == 1)
{
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]))
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###']
@ -643,10 +681,12 @@ class Infusion extends Interpretation
}
// ###CUSTOM_ADMIN_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t");
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###']
= $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t");
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]))
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###']
@ -663,10 +703,12 @@ class Infusion extends Interpretation
elseif ($view['settings']->main_get->gettype == 2)
{
// ###CUSTOM_ADMIN_GET_LIST_QUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###']
= $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]))
{
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###']
@ -681,7 +723,8 @@ class Infusion extends Interpretation
}
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]))
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###']
@ -696,10 +739,12 @@ class Infusion extends Interpretation
}
// ###CUSTOM_ADMIN_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###']
= $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]))
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###']
@ -715,20 +760,25 @@ class Infusion extends Interpretation
}
// ###CUSTOM_ADMIN_CUSTOM_METHODS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###']
= $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###']
.= $this->setCustomViewCustomMethods($view, $view['settings']->code);
// ###CUSTOM_ADMIN_DIPLAY_METHOD### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###']
= $this->setCustomViewDisplayMethod($view);
// set document details
$this->setPrepareDocument($view);
// ###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###']
= $this->setCustomViewExtraDisplayMethods($view);
// ###CUSTOM_ADMIN_CODE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CODE_BODY###'] = $this->setCustomViewCodeBody($view);
// ###CUSTOM_ADMIN_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BODY###'] = $this->setCustomViewBody($view);
// ###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###'] = $this->setCustomViewSubmitButtonScript($view);
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###']
= $this->setCustomViewSubmitButtonScript($view);
// setup the templates
$this->setCustomViewTemplateBody($view);
@ -764,6 +814,9 @@ class Infusion extends Interpretation
// ###UNINSTALL###
$this->fileContentStatic['###UNINSTALL###'] = $this->setUninstall();
// ###UPDATE_VERSION_MYSQL###
$this->setVersionController();
// ###DASHBOARDICONS###
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONS###'] = $this->setDashboardIcons();
@ -885,7 +938,8 @@ class Infusion extends Interpretation
}
// insure the needed route helper is loaded
$this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($view['settings']->code,$view['settings']->code, true);
$this->fileContentStatic['###ROUTEHELPER###']
.= $this->setRouterHelp($view['settings']->code,$view['settings']->code, true);
// build route details
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($view['settings']->code, $view);
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($view['settings']->code);
@ -893,9 +947,11 @@ class Infusion extends Interpretation
if ($view['settings']->main_get->gettype == 1)
{
// set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 1);
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###']
= $this->setUserPermissionCheckAccess($view, 1);
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]))
{
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###']
@ -910,10 +966,12 @@ class Infusion extends Interpretation
}
// ###SITE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t");
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###']
= $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t");
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]))
{
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###']
@ -930,12 +988,15 @@ class Infusion extends Interpretation
elseif ($view['settings']->main_get->gettype == 2)
{
// set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 2);
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###']
= $this->setUserPermissionCheckAccess($view, 2);
// ###SITE_GET_LIST_QUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###']
= $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]))
{
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###']
@ -950,10 +1011,12 @@ class Infusion extends Interpretation
}
// ###SITE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###']
= $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
// check if there is any custom script
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]))
if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code])
&& ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]))
{
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###']
@ -974,17 +1037,22 @@ class Infusion extends Interpretation
}
if (!isset($this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC']))
{
$this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'] = $view['settings']->description;
$this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC']
= $view['settings']->description;
}
// ###SITE_CUSTOM_METHODS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###']
= $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###']
.= $this->setCustomViewCustomMethods($view, $view['settings']->code);
// ###SITE_DIPLAY_METHOD### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view);
$this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###']
= $this->setCustomViewDisplayMethod($view);
// set document details
$this->setPrepareDocument($view);
// ###SITE_EXTRA_DIPLAY_METHODS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view);
$this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###']
= $this->setCustomViewExtraDisplayMethods($view);
// ###SITE_CODE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_CODE_BODY###'] = $this->setCustomViewCodeBody($view);
// ###SITE_BODY### <<<DYNAMIC>>>
@ -993,9 +1061,15 @@ class Infusion extends Interpretation
// setup the templates
$this->setCustomViewTemplateBody($view);
}
// if no default site view was set, the redirect to root
if (!isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']))
{
$this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = '';
}
// set site custom script to helper class
// ###SITE_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###']
= $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
// ###SITE_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = '';
// ###SITE_GLOBAL_EVENT###
@ -1004,14 +1078,17 @@ class Infusion extends Interpretation
if ($this->componentData->add_site_event == 1)
{
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Site Event';
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
$this->fileContentStatic['###SITE_GLOBAL_EVENT###']
.= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
// ###SITE_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Site Event Method.';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###']
.= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###']
.= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
// setup the layouts
@ -1045,7 +1122,8 @@ class Infusion extends Interpretation
$this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL,$this->configFieldSets);
// check if this has been set
if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']))
if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###'])
|| !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']))
{
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = 0;
}
@ -1071,33 +1149,130 @@ class Infusion extends Interpretation
* @return boolean on success
*
*/
public function setLangFileData()
{
// First we build the strings
$lang = array();
// ###LANG_ADMIN###
$lang['###LANG_ADMIN###'] = $this->setLangAdmin();
// ###LANG_ADMIN_SYS###
$lang['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys();
// ###LANG_SITE###
$lang['###LANG_SITE###'] = $this->setLangSite();
// ###LANG_SITE_SYS###
$lang['###LANG_SITE_SYS###'] = $this->setLangSiteSys();
// now we insert the values into the files
if (ComponentbuilderHelper::checkArray($this->langFiles))
$values = array();
$mainLangLoader = array();
// check the admin lang is set
if ($this->setLangAdmin())
{
foreach ($this->langFiles as $file)
$values[] = array_values($this->languages['en-GB']['admin']);
$mainLangLoader['admin'] = count($this->languages['en-GB']['admin']);
}
// check the admin system lang is set
if ($this->setLangAdminSys())
{
$values[] = array_values($this->languages['en-GB']['adminsys']);
$mainLangLoader['adminsys'] = count($this->languages['en-GB']['adminsys']);
}
// check the site lang is set
if (!$this->removeSiteFolder && $this->setLangSite())
{
$values[] = array_values($this->languages['en-GB']['site']);
$mainLangLoader['site'] = count($this->languages['en-GB']['site']);
}
// check the site system lang is set
if (!$this->removeSiteFolder && $this->setLangSiteSys())
{
$values[] = array_values($this->languages['en-GB']['sitesys']);
$mainLangLoader['sitesys'] = count($this->languages['en-GB']['sitesys']);
}
$values = array_unique(ComponentbuilderHelper::mergeArrays($values));
// get the other lang strings if there is any
$this->multiLangString = $this->getMultiLangStrings($values);
// update insert the current lang in to DB
$this->setLangPlaceholders($values);
// remove old unused language strings
$this->purgeLanuageStrings($values);
// path to INI file
$getPAth = $this->templatePath . '/en-GB.com_admin.ini';
// now we insert the values into the files
if (ComponentbuilderHelper::checkArray($this->languages))
{
$langXML = array();
foreach ($this->languages as $tag => $areas)
{
$string = JFile::read($file['path']);
// load the data
$answer = $this->setPlaceholders($string, $lang, 3);
// add to zip array
$this->writeFile($file['path'],$answer);
// set the line counter
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
foreach ($areas as $area => $languageStrings)
{
// force load if debug lines are added
if (!$this->debugLinenr)
{
// check if we sould install this translation
$dif = bcdiv(count($languageStrings), $mainLangLoader[$area]);
$percentage = bcmul($dif, 100);
if ($percentage < $this->percentageLanguageAdd)
{
// dont add
continue;
}
}
$p = 'admin';
$t = '';
if (strpos($area, 'site') !== false)
{
if ($this->removeSiteFolder)
{
continue;
}
$p = 'site';
}
if (strpos($area, 'sys') !== false)
{
$t = '.sys';
}
// build the path to to place the lang file
$path = $this->componentPath.'/'.$p.'/language/'.$tag;
if (!JFolder::exists($path))
{
JFolder::create($path);
// count the folder created
$this->folderCount++;
}
// build the file name
$fileName = $tag . '.com_' . $this->componentCodeName . $t . '.ini';
// move the file to its place
JFile::copy($getPAth, $path.'/'.$fileName);
// count the file created
$this->fileCount++;
// add content to it
$lang = '';
foreach ($languageStrings as $place => $string)
{
$lang .= $place.'="'.$string.'"'.PHP_EOL;
}
// add to language file
$this->writeFile($path.'/'.$fileName, $lang);
// set the line counter
$this->lineCount = $this->lineCount + substr_count($lang, PHP_EOL);
// build xml strings
if (!isset($langXML[$p]))
{
$langXML[$p] = array();
}
$langXML[$p][] = '<language tag="'.$tag.'">language/'.$tag.'/'.$fileName.'</language>';
}
}
// load the lang xml
if (ComponentbuilderHelper::checkArray($langXML))
{
$replace = array();
if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin']))
{
$replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL."\t\t\t", $langXML['admin']);
}
if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
{
$replace['###SITE_LANGUAGES###'] = implode(PHP_EOL."\t\t", $langXML['site']);
}
// build xml path
$xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml';
// get the content in xml
$componentXML = file_get_contents($xmlPath);
// update the xml content
$componentXML = $this->setPlaceholders($componentXML, $replace);
// store the values back to xml
$this->writeFile($xmlPath,$componentXML);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,348 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilderemail.php
@author Llewellyn van der Merwe <http://vdm.bz/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
/-----------------------------------------------------------------------------------------------------------------------------*/
/**
* Componentbuilder component email helper
*/
abstract class ComponentbuilderEmail
{
/**
* Configuraiton object
*
* @var JConfig
*/
public static $config = null;
/**
* Mailer object
*
* @var JMail
*/
public static $mailer = null;
/**
* Get a configuration object
*
*/
public static function getConfig()
{
if (!self::$config)
{
self::$config = JComponentHelper::getParams('com_componentbuilder');
}
return self::$config;
}
/**
* Get a mailer object.
*
* Returns the global {@link JMail} object, only creating it if it doesn't already exist.
*
* @return JMail object
*
* @see JMail
*/
public static function getMailer()
{
if (!self::$mailer)
{
self::$mailer = self::createMailer();
}
$copy = clone self::$mailer;
return $copy;
}
/**
* Create a mailer object
*
* @return JMail object
*
* @see JMail
*/
protected static function createMailer()
{
// set component params
$conf = self::getConfig();
// now load the mailer
$mailer = $conf->get('mailer', 'global');
// Create a JMail object
$mail = JMail::getInstance();
// check if set to global
if ('global' == $mailer)
{
// get the global details
$globalConf = JFactory::getConfig();
$mailer = $globalConf->get('mailer');
$smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
$smtpuser = $globalConf->get('smtpuser');
$smtppass = $globalConf->get('smtppass');
$smtphost = $globalConf->get('smtphost');
$smtpsecure = $globalConf->get('smtpsecure');
$smtpport = $globalConf->get('smtpport');
$sendmail = $globalConf->get('sendmail');
$mailfrom = $globalConf->get('mailfrom');
$fromname = $globalConf->get('fromname');
$replyto = $globalConf->get('replyto');
$replytoname = $globalConf->get('replytoname');
}
else
{
$smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
$smtpuser = $conf->get('smtpuser');
$smtppass = $conf->get('smtppass');
$smtphost = $conf->get('smtphost');
$smtpsecure = $conf->get('smtpsecure');
$smtpport = $conf->get('smtpport');
$sendmail = $conf->get('sendmail');
$mailfrom = $conf->get('mailfrom');
$fromname = $conf->get('fromname');
$replyto = $conf->get('replyto');
$replytoname = $conf->get('replytoname');
}
// set the global reply-to if found
if ($replyto && $replytoname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $replyto, $replytoname ) );
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// Default mailer is to use PHP's mail function
switch ($mailer)
{
case 'smtp':
// set the SMTP option
$mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
break;
case 'sendmail':
// set the sendmail option
$mail->useSendmail($sendmail);
$mail->IsSendmail();
break;
default:
$mail->IsMail();
break;
}
return $mail;
}
/**
* Send an email
*
* @return bool on success
*
*/
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
{
// Get a JMail instance
$mail = self::getMailer();
// set component params
$conf = self::getConfig();
// do some house cleaning
$mail->ClearReplyTos();
// set if we have override
if ($mailfrom && $fromname)
{
$mail->setSender(array($mailfrom, $fromname));
}
// load the bounce email as sender if set
if (!is_null($bounce_email))
{
$mail->Sender = $bounce_email;
}
// Add tag to email to identify it
if (!is_null($idsession))
{
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
}
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
// Are we sending the email as HTML?
if ($mode)
{
$mail->IsHTML(true);
$mail->AltBody = $textonly;
}
//embed images
if ($embeded)
{
if(ComponentbuilderHelper::checkArray($embeds))
{
foreach($embeds as $embed)
{
$mail->AddEmbeddedImage($embed->Path,$embed->FileName);
}
}
}
$mail->addRecipient($recipient);
$mail->addCC($cc);
$mail->addBCC($bcc);
$mail->addAttachment($attachment);
// Take care of reply email addresses
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);
}
}
elseif (!empty($mailreply))
{
$mail->ClearReplyTos();
$mail->addReplyTo($mailreply, $replyname);
}
// check if we can add the DKIM to email
if ($conf->get('enable_dkim'))
{
if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
$mail->DKIM_domain = $conf->get('dkim_domain');
$mail->DKIM_selector = $conf->get('dkim_selector');
$mail->DKIM_identity = $conf->get('dkim_identity');
$mail->DKIM_passphrase = $conf->get('dkim_passphrase');
$tmp = tempnam(sys_get_temp_dir(), 'VDM');
$h = fopen($tmp, 'w');
fwrite($h, $conf->get('dkim_private'));
fclose($h);
$mail->DKIM_private = $tmp;
}
}
$sendmail = $mail->Send();
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
@unlink($tmp);
}
if (method_exists('ComponentbuilderHelper','storeMessage'))
{
// store the massage if the method is set
ComponentbuilderHelper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email');
}
return $sendmail;
}
/**
* Set html text (in a row) and subject (as title) to a email table.
* do not use <p> instead use <br />
* in your html that you pass to this method
* since it is a table row it does not
* work well with paragraphs
*
* @return string on success
*
*/
public static function setTableBody($html, $subject)
{
$body = array();
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
$body[] = "<head>";
$body[] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$body[] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>";
$body[] = "<title>".$subject."</title>";
$body[] = "<style type=\"text/css\">";
$body[] = "#outlook a {padding:0;}";
$body[] = ".ExternalClass {width:100%;}";
$body[] = ".ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} ";
$body[] = "p {margin: 0; padding: 0; font-size: 0px; line-height: 0px;} ";
$body[] = "table td {border-collapse: collapse;}";
$body[] = "table {border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }";
$body[] = "img {display: block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;}";
$body[] = "a img {border: none;}";
$body[] = "a {text-decoration: none; color: #000001;}";
$body[] = "a.phone {text-decoration: none; color: #000001 !important; pointer-events: auto; cursor: default;}";
$body[] = "span {font-size: 13px; line-height: 17px; font-family: monospace; color: #000001;}";
$body[] = "</style>";
$body[] = "<!--[if gte mso 9]>";
$body[] = "<style>";
$body[] = "/* Target Outlook 2007 and 2010 */";
$body[] = "</style>";
$body[] = "<![endif]-->";
$body[] = "</head>";
$body[] = "<body style=\"width:100%; margin:0; padding:0; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;\">";
$body[] = "\n<!-- body wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin:0; padding:0; width:100%; line-height: 100% !important;\">";
$body[] = "<tr>";
$body[] = "<td valign=\"top\">";
$body[] = "<!-- edge wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"800\" >";
$body[] = "<tr>";
$body[] = "<td valign=\"top\">";
$body[] = "<!-- content wrapper -->";
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"780\">";
$body[] = "<tr>";
$body[] = "<td valign=\"top\" style=\"vertical-align: top;\">";
$body[] = $html;
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / content wrapper -->";
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / edge wrapper -->";
$body[] = "</td>";
$body[] = "</tr>";
$body[] = "</table>";
$body[] = "<!-- / page wrapper -->";
$body[] = "</body>";
$body[] = "</html>";
return implode("\n", $body);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage headercheck.php
@ -26,7 +26,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
class HeaderCheck
class componentbuilderHeaderCheck
{
function js_loaded($script_name)
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage indenter.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage js.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.6
@build 1st March, 2017
@version 2.5.1
@build 23rd August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage minify.php

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