Compare commits

...

18 Commits

Author SHA1 Message Date
319944db68 Next test release of new update server 2016-11-22 11:22:45 +02:00
52f7737f5c updated the update server link 2016-11-22 11:21:50 +02:00
05160b499f Improved the compiler, added the option to add the update server file to the zipped package, fixed a few bugs. 2016-11-22 07:48:55 +02:00
07f9344265 Fixed some compile errors in relation to the adding of config fields to target a view menu relationship. Changed the notice area to give little reminder when new notice are sent. 2016-10-31 23:47:21 +02:00
e63441531b Fixed the compiler run on readme placeholder error 2016-10-24 01:05:06 +02:00
33f3bb5652 Added lots more demo data on Github to help demonstrate the ease of use. Adding feature to insert custom scripting during install. Adding easy issue tracking, and member notice board. Many bug fixes, to the compiler and general improvements. 2016-10-24 00:48:26 +02:00
ecb3ab5af9 Added custom buttons to admin views, improved the compiler code, with some bug fixes 2016-09-11 17:27:04 +02:00
8fbd4f8701 Added the updating sql files, sorry! 2016-09-07 23:37:07 +02:00
b8311078ac Added PHP (script - before publish) & PHP (script - after publish)
with some fixes to the compiler
2016-09-07 23:20:58 +02:00
f8d5145af9 Bug fix to getCustomScriptBuilder sig 2016-09-04 00:14:54 +01:00
a7e641b499 Added another PHP field to the admin views, improved the custom code methods in the compiler, and fixed some permissional errors. 2016-09-03 22:44:47 +01:00
675ecece84 Compiled update 2016-08-29 20:46:01 +01:00
f76587361b Fixed #14 the sql field type build method 2016-07-17 11:24:51 +01:00
2f9e54e371 Resolved #9 Layout Issue - Custom Lookup Field. 2016-07-12 22:07:55 +01:00
53cf534664 Fixed image link in readme.md 2016-06-28 05:27:09 +01:00
5567ca6856 New Release 2016-06-27 12:12:29 +01:00
7546e9aceb New Release 2016-06-27 12:05:53 +01:00
f09fd06ddc Removed $_GET from all callback response and used JInput instead 2016-06-24 15:23:01 +01:00
454 changed files with 13759 additions and 6853 deletions

122
README.md
View File

@ -1,44 +1,122 @@
# Component Builder (2.1.13)
# Component Builder (2.2.3)
This is a [Joomla 3.x] (http://www.joomla.org/) component.
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.png "The Component Builder")
![Component Builder image](https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/admin/assets/images/component-300.jpg "The Component Builder")
The Component Builder for Joomla that is highly advanced, truly able to build extremely complex components in a fraction of the time.
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.
> **You can purchase demo content inside Component Builder:**
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!
+ **Development Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
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.2.3) with **ALL** its features and **ALL** concepts totally open-source and free!
*Help View Integration*
Once installed upgrades are quick and easy via the default Joomla upgrade area.
*Demo Component* see the build on [github] (https://github.com/namibia/demo-joomla-3-component)
# Some of the Features
+ **Dev + Howtos Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited Joomla Components.
+ Unlimited Tables/Views.
+ Reusing Views and Fields.
+ Runs on Your Own Joomla Install.
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
+ Build data query of extreme complex nature to use in Dynamic/custom views.
+ Highly Dynamic/custom Front-end Structures.
+ Dynamically setup templates and layouts for Front-end design.
+ Integration of the excellent UIKIT lib.
+ Integration of the excellent FOOTABLE lib.
+ All Joomla Standard Field Types (including repeatable fields).
+ Strong Implementation of all Joomla Form Security.
+ Load data via ajax with ease.
+ You can add an Update Server to Components you build.
+ Build advanced Dynamic front-end forms.
+ Dynamic data queries from multiple tables.
+ Place in local GIT folder, and publish to sales server.
+ Include any amount of custom files and folders during build.
+ Static helper class with smart methods already included.
+ Static helper methods Can easily be added.
+ Direct install from complier view.
+ Integrative with native Joomla Categories and Tags.
+ Fully Dynamic Search Friendly URL Auto Implementation.
+ Custom scripting options all over the MVC structure.
+ Permission implementation down to each view, item and field.
+ Easy extendible to include other libraries.
+ Can include SQL and visioning update link to distribute your component updates via Joomla default upgrade of components.
+ Easy Export & Import addon to all backend-tables.
+ Overriding ability of import concepts in all backend-tables.
+ The Batch and Filter implementation on all backend-list views.
+ This and much much more are all possible with this component builder!
*All the above*
# Just Imagine
*Sermon Distributor* see the build on [github] (https://github.com/SermonDistributor/Joomla-3-Component)
+ Your Component Back-end can be more advanced then the Joomla Article Manager.
+ Your Code as Perfectly Unified to the strict Joomla Standards.
+ Adding Custom Scripting almost anywhere in the MVC structure.
+ Import and export feature to all backend-views.
+ Batch copy and move/update feature for all backend-views.
+ History tracking per/change made on any back-end item.
+ Dynamic field control, to show and hide fields in amazing ways.
+ Front-end freedom of design that allows for any library to be used.
+ This and much much more are all possible with this component builder!
*Training & Help Videos* tutorials in the component included.
# You are in Control
+ You can change the licensing template for your components.
+ You can change/improve existing field types and add more.
+ Line numbers to show where in compiler was the code build.
+ You can improve the component since all code are open-source.
+ Free updates for the lifetime of the project.
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ 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:**
+ 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.
[**GET ACCESS NOW!**](https://www.vdm.io/joomla-component-builder#get)
# gitHub Support
Would you require more help please open and issue here on [gitHub today](https://github.com/vdm-io/Joomla-Component-Builder/issues)!
# WHY GIVE IT AWAY LIKE THIS?
> I am an Open Source Enthusiast
> Who Support the Joomla Community
My idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers (more advanced then me) end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
# MAKING IT BETTER!
Component Builder is mapped as a component in itself on my local development environment. So I am improving it like you would any other component in it. I am looking for developers with the **skill** and the **desire** to really join me... and then I will possible give them access to this, so we can all help improve this simple, yet advanced tool.
# Build Details
+ *Company*: [Vast Development Method] (https://www.vdm.io/joomla-component-builder)
+ *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io)
+ *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder)
+ *Company*: [Vast Development Method](https://www.vdm.io/joomla-component-builder)
+ *Author*: [Llewellyn van der Merwe](mailto:info@vdm.io)
+ *Name*: [Component Builder](https://www.vdm.io/joomla-component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 23rd June, 2016
+ *Version*: 2.1.13
+ *Last Build*: 22nd November, 2016
+ *Version*: 2.2.3
+ *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*: **83183**
+ *File count*: **506**
+ *Folder count*: **98**
+ *Line count*: **86456**
+ *File count*: **540**
+ *Folder count*: **99**
> This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder).
> Developed by [Llewellyn van der Merwe] (mailto:joomla@vdm.io)
> This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Donations
If you want to support this project, please consider donating:
* PayPal: pay@vdm.io
* Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3

122
admin/README.txt Normal file
View File

@ -0,0 +1,122 @@
# Component Builder (2.2.3)
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")
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.2.3) 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.
# Some of the Features
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited Joomla Components.
+ Unlimited Tables/Views.
+ Reusing Views and Fields.
+ Runs on Your Own Joomla Install.
+ Add Dynamic/custom back-end views that uses Table and Chart result sets.
+ Build data query of extreme complex nature to use in Dynamic/custom views.
+ Highly Dynamic/custom Front-end Structures.
+ Dynamically setup templates and layouts for Front-end design.
+ Integration of the excellent UIKIT lib.
+ Integration of the excellent FOOTABLE lib.
+ All Joomla Standard Field Types (including repeatable fields).
+ Strong Implementation of all Joomla Form Security.
+ Load data via ajax with ease.
+ You can add an Update Server to Components you build.
+ Build advanced Dynamic front-end forms.
+ Dynamic data queries from multiple tables.
+ Place in local GIT folder, and publish to sales server.
+ Include any amount of custom files and folders during build.
+ Static helper class with smart methods already included.
+ Static helper methods Can easily be added.
+ Direct install from complier view.
+ Integrative with native Joomla Categories and Tags.
+ Fully Dynamic Search Friendly URL Auto Implementation.
+ Custom scripting options all over the MVC structure.
+ Permission implementation down to each view, item and field.
+ Easy extendible to include other libraries.
+ Can include SQL and visioning update link to distribute your component updates via Joomla default upgrade of components.
+ Easy Export & Import addon to all backend-tables.
+ Overriding ability of import concepts in all backend-tables.
+ The Batch and Filter implementation on all backend-list views.
+ This and much much more are all possible with this component builder!
# Just Imagine
+ Your Component Back-end can be more advanced then the Joomla Article Manager.
+ Your Code as Perfectly Unified to the strict Joomla Standards.
+ Adding Custom Scripting almost anywhere in the MVC structure.
+ Import and export feature to all backend-views.
+ Batch copy and move/update feature for all backend-views.
+ History tracking per/change made on any back-end item.
+ Dynamic field control, to show and hide fields in amazing ways.
+ Front-end freedom of design that allows for any library to be used.
+ This and much much more are all possible with this component builder!
# You are in Control
+ You can change the licensing template for your components.
+ You can change/improve existing field types and add more.
+ Line numbers to show where in compiler was the code build.
+ You can improve the component since all code are open-source.
+ Free updates for the lifetime of the project.
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
+ 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:**
+ 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.
[**GET ACCESS NOW!**](https://www.vdm.io/joomla-component-builder#get)
# gitHub Support
Would you require more help please open and issue here on [gitHub today](https://github.com/vdm-io/Joomla-Component-Builder/issues)!
# WHY GIVE IT AWAY LIKE THIS?
> I am an Open Source Enthusiast
> Who Support the Joomla Community
My idea was to almost let this tool serve as a cheat sheet to how things can be done... and with the help of other developers (more advanced then me) end up formulating the way how things not only can, but must be done to insure secure, stable, scalable and maintainable code is produced.
# MAKING IT BETTER!
Component Builder is mapped as a component in itself on my local development environment. So I am improving it like you would any other component in it. I am looking for developers with the **skill** and the **desire** to really join me... and then I will possible give them access to this, so we can all help improve this simple, yet advanced tool.
# Build Details
+ *Company*: [Vast Development Method](https://www.vdm.io/joomla-component-builder)
+ *Author*: [Llewellyn van der Merwe](mailto:info@vdm.io)
+ *Name*: [Component Builder](https://www.vdm.io/joomla-component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 22nd November, 2016
+ *Version*: 2.2.3
+ *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*: **86456**
+ *File count*: **540**
+ *Folder count*: **99**
> This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Donations
If you want to support this project, please consider donating:
* PayPal: pay@vdm.io
* Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage component.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage components.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_view.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_views.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dashboard.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_get.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_gets.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage field.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fields.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_document.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_documents.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layout.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layouts.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_view.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_views.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippet.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippets.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage template.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,13 +9,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage templates.css
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

View File

@ -486,7 +486,7 @@ abstract class ###Component###Helper
if (!$asset->check() || !$asset->store())
{
JError::raiseWarning(500, $asset->getError());
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else

View File

@ -171,7 +171,7 @@ abstract class ###Component###Helper
if (!$asset->check() || !$asset->store())
{
JError::raiseWarning(500, $asset->getError());
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else

View File

@ -50,7 +50,7 @@ class ###Component###Controller###View### extends JControllerForm
{
$this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
}###ADMIN_CUSTOM_BUTTONS_CONTROLLER###
/**
* Method override to check if you can add a new record.

View File

@ -63,9 +63,9 @@ class ###Component###ControllerAjax extends JControllerLegacy
}
else
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode(false).");";
echo $callback."(".json_encode(false).");";
}
else
{

View File

@ -63,9 +63,9 @@ class ###Component###ControllerAjax extends JControllerLegacy
}
else
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode(false).");";
echo $callback."(".json_encode(false).");";
}
else
{

View File

@ -67,7 +67,7 @@ class ###Component###Model###View### extends JModelAdmin
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
}###ADMIN_CUSTOM_BUTTONS_METHOD###
/**
* Method to get a single record.
@ -267,6 +267,26 @@ class ###Component###Model###View### extends JModelAdmin
return true;
}
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since 12.2
*/
public function publish(&$pks, $value = 1)
{###JMODELADMIN_BEFORE_PUBLISH###
if (!parent::publish($pks, $value))
{
return false;
}###JMODELADMIN_AFTER_PUBLISH###
return true;
}
/**
* Method to perform batch operations on an item or a set of items.

View File

@ -97,9 +97,10 @@ class ###Component###Model###SView### extends JModelItem
// check if this user has permission to access item
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
{
JError::raiseWarning(500, JText::_('Not authorised!'));
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct (TODO for now we go to default view)
JFactory::getApplication()->redirect('index.php?option=com_###component###');
$app->redirect('index.php?option=com_###component###');
return false;
}
$this->userId = $this->user->get('id');
@ -126,7 +127,7 @@ class ###Component###Model###SView### extends JModelItem
if ($e->getCode() == 404)
{
// Need to go thru the error handler to allow Redirect to work.
JError::raiseError(404, $e->getMessage());
JError::raiseWaring(404, $e->getMessage());
}
else
{

View File

@ -99,9 +99,10 @@ class ###Component###Model###SView### extends JModelItem
// check if this user has permission to access item
if (!$this->user->authorise('site.###sview###.access', 'com_###component###'))
{
JError::raiseWarning(500, JText::_('Not authorised!'));
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct (TODO for now we go to default view)
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###'));
$app->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###'));
return false;
}
$this->userId = $this->user->get('id');
@ -128,7 +129,7 @@ class ###Component###Model###SView### extends JModelItem
if ($e->getCode() == 404)
{
// Need to go thru the error handler to allow Redirect to work.
JError::raiseError(404, $e->getMessage());
JError::raiseWaring(404, $e->getMessage());
}
else
{

View File

@ -201,7 +201,8 @@ class ###Component###ModelImport extends JModelLegacy
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw');
@ -209,21 +210,21 @@ class ###Component###ModelImport extends JModelLegacy
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
@ -261,7 +262,8 @@ class ###Component###ModelImport extends JModelLegacy
*/
protected function _getPackageFromFolder()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
@ -269,7 +271,7 @@ class ###Component###ModelImport extends JModelLegacy
// Did you give us a valid path?
if (!file_exists($p_dir))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@ -279,7 +281,7 @@ class ###Component###ModelImport extends JModelLegacy
// Did you give us a valid package?
if (!$type)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
@ -290,7 +292,7 @@ class ###Component###ModelImport extends JModelLegacy
break;
default:
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
@ -310,15 +312,16 @@ class ###Component###ModelImport extends JModelLegacy
*/
protected function _getPackageFromUrl()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
// Did you give us a URL?
if (!$url)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
@ -328,7 +331,7 @@ class ###Component###ModelImport extends JModelLegacy
// Was the package downloaded?
if (!$p_file)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@ -349,6 +352,7 @@ class ###Component###ModelImport extends JModelLegacy
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
@ -362,7 +366,7 @@ class ###Component###ModelImport extends JModelLegacy
default:
// Cleanup the import files
$this->remove($archivename);
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}

View File

@ -91,7 +91,8 @@ class ###Component###Model###View### extends JModelLegacy
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw');
@ -99,21 +100,21 @@ class ###Component###Model###View### extends JModelLegacy
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
@ -151,7 +152,8 @@ class ###Component###Model###View### extends JModelLegacy
*/
protected function _getPackageFromFolder()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
@ -159,7 +161,7 @@ class ###Component###Model###View### extends JModelLegacy
// Did you give us a valid path?
if (!file_exists($p_dir))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@ -169,7 +171,7 @@ class ###Component###Model###View### extends JModelLegacy
// Did you give us a valid package?
if (!$type)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
@ -180,7 +182,7 @@ class ###Component###Model###View### extends JModelLegacy
break;
default:
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
@ -200,7 +202,8 @@ class ###Component###Model###View### extends JModelLegacy
*/
protected function _getPackageFromUrl()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
@ -208,7 +211,7 @@ class ###Component###Model###View### extends JModelLegacy
// Did you give us a URL?
if (!$url)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
@ -218,7 +221,7 @@ class ###Component###Model###View### extends JModelLegacy
// Was the package downloaded?
if (!$p_file)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@ -239,6 +242,7 @@ class ###Component###Model###View### extends JModelLegacy
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
@ -252,7 +256,7 @@ class ###Component###Model###View### extends JModelLegacy
default:
// Cleanup the import files
$this->remove($archivename);
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}

View File

@ -95,7 +95,7 @@ class ###Component###Model###Views### extends JModelList
public function getItems()
{###LICENSE_LOCKED_CHECK### ###CHECKINCALL###
// load parent items
$items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX### ###SELECTIONTRANSLATIONFIX###
$items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX### ###SELECTIONTRANSLATIONFIX### ###GET_ITEMS_METHOD_AFTER_ALL###
// return items
return $items;

View File

@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList
// check if this user has permission to access items
if (!$user->authorise('###sviews###.access', 'com_###component###'))
{
JError::raiseWarning(500, JText::_('Not authorised!'));
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct (TODO for now we go to default view)
JFactory::getApplication()->redirect('index.php?option=com_###component###');
$app->redirect('index.php?option=com_###component###');
return false;
}###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS###
// load parent items

View File

@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList
// check if this user has permission to access items
if (!$user->authorise('site.###sview###.access', 'com_###component###'))
{
JError::raiseWarning(500, JText::_('Not authorised!'));
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct (TODO for now we go to default view)
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###'));
$app->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###'));
return false;
}###LICENSE_LOCKED_CHECK### ###SITE_BEFORE_GET_ITEMS###
// load parent items

View File

@ -0,0 +1 @@
###README###

View File

@ -55,7 +55,8 @@ class ###Component###ControllerAjax extends JControllerLegacy
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
if($user->id != 0 && $token == $call_token){
if($user->id != 0 && $token == $call_token)
{
$task = $this->getTask();
switch($task){
case 'fieldRequired':
@ -73,26 +74,37 @@ class ###Component###ControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET)){
echo $_GET['callback'] . "(".json_encode($result).");";
} else {
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
catch(Exception $e)
{
if(array_key_exists('callback',$_GET)){
echo $_GET['callback']."(".json_encode($e).");";
} else {
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
}
} else {
if(array_key_exists('callback',$_GET)){
echo $_GET['callback']."(".json_encode(false).");";
} else {
}
else
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode(false).");";
}
else
{
echo "(".json_encode(false).");";
}
}

View File

@ -74,7 +74,7 @@
<filename>config.xml</filename>
<filename>controller.php</filename>###ENCRYPT_FILE###
<filename>index.html</filename>
<filename>###component###.php</filename>
<filename>###component###.php</filename>###EXSTRA_ADMIN_FILES###
<folder>assets</folder>
<folder>controllers</folder>
<folder>helpers</folder>

View File

@ -32,7 +32,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_###component###'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR'));
};
// Load cms libraries

View File

@ -35,20 +35,9 @@ JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
?>
<?php if ($this->canDo->get('###sview###.access')): ?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task == '###sview###.back') {
parent.history.back();
return false;
} else {
var form = document.getElementById('adminForm');
form.task.value = task;
form.submit();
}
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_costbenefitprojection&view=###sview###&id='.$this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
<form action="<?php echo JRoute::_('index.php?option=com_###component###&view=###sview###'.$urlId); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>###CUSTOM_ADMIN_BODY###

View File

@ -32,6 +32,7 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>
<script type="text/javascript">
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList)) : ?>

View File

@ -32,4 +32,5 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>###IMPORT_DEFAULT_VIEW_CUSTOM###

View File

@ -35,19 +35,7 @@ JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
?>
<?php if ($this->canDo->get('###sview###.access')): ?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task == '###sview###.back') {
parent.history.back();
return false;
} else {
var form = document.getElementById('adminForm');
form.task.value = task;
form.submit();
}
}
</script>
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
<form action="<?php echo JRoute::_('index.php?option=com_###component###&view=###sviews###'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<input type="hidden" name="task" value="" />###HIDDEN_INPUT_VALUES###
<?php echo JHtml::_('form.token'); ?>

View File

@ -41,7 +41,6 @@ class com_###component###InstallerScript
/**
* method to install the component
*
*
* @return void
*/
function install($parent)
@ -81,18 +80,28 @@ class com_###component###InstallerScript
*/
function preflight($type, $parent)
{
// get application
$app = JFactory::getApplication();
// is redundant ...hmmm
if ($type == 'uninstall')
{
{
return true;
}
$app = JFactory::getApplication();
// the default for both install and update
$jversion = new JVersion();
if (!$jversion->isCompatible('3.4.1'))
if (!$jversion->isCompatible('3.6.0'))
{
$app->enqueueMessage('Please upgrade to at least Joomla! 3.4.1 before continuing!', 'error');
$app->enqueueMessage('Please upgrade to at least Joomla! 3.6.0 before continuing!', 'error');
return false;
}
// do any updates needed
if ($type == 'update')
{###PREUPDATESCRIPT###
}
// do any install needed
if ($type == 'install')
{###PREINSTALLSCRIPT###
}
}
/**
@ -104,11 +113,11 @@ class com_###component###InstallerScript
{
// set the default component settings
if ($type == 'install')
{###INSTALLSCRIPT###
{###POSTINSTALLSCRIPT###
}
// do any updates needed
if ($type == 'update')
{###UPDATESCRIPT###
{###POSTUPDATESCRIPT###
}
}
}

View File

@ -193,6 +193,12 @@
"rename": false,
"type": "file"
},
"README.txt": {
"naam":"README.txt",
"path": "c0mp0n3nt/admin",
"rename": false,
"type": "file"
},
"README.md": {
"naam":"README.md",
"path": "c0mp0n3nt/",

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@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/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -30,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_componentbuilder'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR'));
};
// Load cms libraries

View File

@ -85,271 +85,6 @@
readonly="true"
class="readonly"
/>
<field type="spacer" name="spacerContributor1" hr="true" />
<field name="contributor1"
type="spacer"
class="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_ONE"
/>
<field name="titleContributor1"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default="My Wife"
/>
<field name="nameContributor1"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default="Roline van der Merwe"
/>
<field name="emailContributor1"
type="email"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default="info@vdm.io"
/>
<field name="linkContributor1"
type="url"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default="http://www.vdm.io/"
/>
<field name="useContributor1"
type="list"
default="2"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor1"
type="list"
default="3"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
<field type="spacer" name="spacerContributor2" hr="true" />
<field name="contributor2"
type="spacer"
class="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TWO"
/>
<field name="titleContributor2"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default=""
/>
<field name="nameContributor2"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default=""
/>
<field name="emailContributor2"
type="email"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default=""
/>
<field name="linkContributor2"
type="url"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default=""
/>
<field name="useContributor2"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor2"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
<field type="spacer" name="spacerContributor3" hr="true" />
<field name="contributor3"
type="spacer"
class="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_THREE"
/>
<field name="titleContributor3"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default=""
/>
<field name="nameContributor3"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default=""
/>
<field name="emailContributor3"
type="email"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default=""
/>
<field name="linkContributor3"
type="url"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default=""
/>
<field name="useContributor3"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor3"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
<field type="spacer" name="spacerContributor4" hr="true" />
<field name="contributor4"
type="spacer"
class="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_FOUR"
/>
<field name="titleContributor4"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default=""
/>
<field name="nameContributor4"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default=""
/>
<field name="emailContributor4"
type="email"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default=""
/>
<field name="linkContributor4"
type="url"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default=""
/>
<field name="useContributor4"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor4"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
<field type="spacer" name="spacerContributor5" hr="true" />
<field name="contributor5"
type="spacer"
class="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_FIVE"
/>
<field name="titleContributor5"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default=""
/>
<field name="nameContributor5"
type="text"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default=""
/>
<field name="emailContributor5"
type="email"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default=""
/>
<field name="linkContributor5"
type="url"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default=""
/>
<field name="useContributor5"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor5"
type="list"
default="0"
label="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_COMPONENTBUILDER_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
</fieldset>
<fieldset
name="uikit_config"

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage controller.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage ajax.json.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -43,6 +42,8 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"');
JResponse::setHeader("Access-Control-Allow-Origin", "*");
// load the tasks
$this->registerTask('isNew', 'ajax');
$this->registerTask('isRead', 'ajax');
$this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getImportScripts', 'ajax');
@ -68,6 +69,82 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$task = $this->getTask();
switch($task)
{
case 'isNew':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$noticeValue = $jinput->get('notice', NULL, 'STRING');
if($noticeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->isNew($noticeValue);
}
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 'isRead':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$noticeValue = $jinput->get('notice', NULL, 'STRING');
if($noticeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->isRead($noticeValue);
}
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
{
@ -81,9 +158,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -96,9 +173,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -119,9 +196,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -134,9 +211,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -157,9 +234,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -172,9 +249,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -195,9 +272,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -210,9 +287,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -233,9 +310,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -248,9 +325,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -271,9 +348,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -286,9 +363,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -310,9 +387,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -325,9 +402,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -348,9 +425,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -363,9 +440,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -388,9 +465,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -403,9 +480,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -428,9 +505,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -443,9 +520,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -466,9 +543,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -481,9 +558,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -495,9 +572,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
else
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode(false).");";
echo $callback."(".json_encode(false).");";
}
else
{

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage component.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@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/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage components.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_view.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_views.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_get.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_gets.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage field.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fields.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_document.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_documents.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage import.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layout.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layouts.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_view.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_views.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippet.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage template.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -10,13 +10,12 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.13
@build 23rd June, 2016
@version 2.2.3
@build 22nd November, 2016
@created 30th April, 2015
@package Component Builder
@subpackage templates.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

BIN
admin/custom/ajax.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

216
admin/custom/base64.js Normal file
View File

@ -0,0 +1,216 @@
/*
Copyright (c) 2008 Fred Palmer fred.palmer_at_gmail.com
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
function StringBuffer()
{
this.buffer = [];
}
StringBuffer.prototype.append = function append(string)
{
this.buffer.push(string);
return this;
};
StringBuffer.prototype.toString = function toString()
{
return this.buffer.join("");
};
var Base64 =
{
codex : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode : function (input)
{
var output = new StringBuffer();
var enumerator = new Utf8EncodeEnumerator(input);
while (enumerator.moveNext())
{
var chr1 = enumerator.current;
enumerator.moveNext();
var chr2 = enumerator.current;
enumerator.moveNext();
var chr3 = enumerator.current;
var enc1 = chr1 >> 2;
var enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
var enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
var enc4 = chr3 & 63;
if (isNaN(chr2))
{
enc3 = enc4 = 64;
}
else if (isNaN(chr3))
{
enc4 = 64;
}
output.append(this.codex.charAt(enc1) + this.codex.charAt(enc2) + this.codex.charAt(enc3) + this.codex.charAt(enc4));
}
return output.toString();
},
decode : function (input)
{
var output = new StringBuffer();
var enumerator = new Base64DecodeEnumerator(input);
while (enumerator.moveNext())
{
var charCode = enumerator.current;
if (charCode < 128)
output.append(String.fromCharCode(charCode));
else if ((charCode > 191) && (charCode < 224))
{
enumerator.moveNext();
var charCode2 = enumerator.current;
output.append(String.fromCharCode(((charCode & 31) << 6) | (charCode2 & 63)));
}
else
{
enumerator.moveNext();
var charCode2 = enumerator.current;
enumerator.moveNext();
var charCode3 = enumerator.current;
output.append(String.fromCharCode(((charCode & 15) << 12) | ((charCode2 & 63) << 6) | (charCode3 & 63)));
}
}
return output.toString();
}
}
function Utf8EncodeEnumerator(input)
{
this._input = input;
this._index = -1;
this._buffer = [];
}
Utf8EncodeEnumerator.prototype =
{
current: Number.NaN,
moveNext: function()
{
if (this._buffer.length > 0)
{
this.current = this._buffer.shift();
return true;
}
else if (this._index >= (this._input.length - 1))
{
this.current = Number.NaN;
return false;
}
else
{
var charCode = this._input.charCodeAt(++this._index);
// "\r\n" -> "\n"
//
if ((charCode == 13) && (this._input.charCodeAt(this._index + 1) == 10))
{
charCode = 10;
this._index += 2;
}
if (charCode < 128)
{
this.current = charCode;
}
else if ((charCode > 127) && (charCode < 2048))
{
this.current = (charCode >> 6) | 192;
this._buffer.push((charCode & 63) | 128);
}
else
{
this.current = (charCode >> 12) | 224;
this._buffer.push(((charCode >> 6) & 63) | 128);
this._buffer.push((charCode & 63) | 128);
}
return true;
}
}
}
function Base64DecodeEnumerator(input)
{
this._input = input;
this._index = -1;
this._buffer = [];
}
Base64DecodeEnumerator.prototype =
{
current: 64,
moveNext: function()
{
if (this._buffer.length > 0)
{
this.current = this._buffer.shift();
return true;
}
else if (this._index >= (this._input.length - 1))
{
this.current = 64;
return false;
}
else
{
var enc1 = Base64.codex.indexOf(this._input.charAt(++this._index));
var enc2 = Base64.codex.indexOf(this._input.charAt(++this._index));
var enc3 = Base64.codex.indexOf(this._input.charAt(++this._index));
var enc4 = Base64.codex.indexOf(this._input.charAt(++this._index));
var chr1 = (enc1 << 2) | (enc2 >> 4);
var chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
var chr3 = ((enc3 & 3) << 6) | enc4;
this.current = chr1;
if (enc3 != 64)
this._buffer.push(chr2);
if (enc4 != 64)
this._buffer.push(chr3);
return true;
}
}
};

144
admin/custom/bootstrap-tab.js vendored Normal file
View File

@ -0,0 +1,144 @@
/* ========================================================
* bootstrap-tab.js v2.3.1
* https://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* TAB CLASS DEFINITION
* ==================== */
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype = {
constructor: Tab
, show: function () {
var $this = this.element
, $ul = $this.closest('ul:not(.dropdown-menu)')
, selector = $this.attr('data-target')
, previous
, $target
, e
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ( $this.parent('li').hasClass('active') ) return
previous = $ul.find('.active:last a')[0]
e = $.Event('show', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
$target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
, activate: function ( element, container, callback) {
var $active = container.find('> .active')
, transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active.one($.support.transition.end, next) :
next()
$active.removeClass('in')
}
}
/* TAB PLUGIN DEFINITION
* ===================== */
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('tab')
if (!data) $this.data('tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
/* TAB NO CONFLICT
* =============== */
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
/* TAB DATA-API
* ============ */
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
}(window.jQuery);

7
admin/custom/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

251
admin/custom/bootstrapSwitch.js vendored Normal file
View File

@ -0,0 +1,251 @@
/* ============================================================
* bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
* https://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* https://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
!function ($) {
"use strict";
$.fn['bootstrapSwitch'] = function (method) {
var methods = {
init: function () {
return this.each(function () {
var $element = $(this)
, $div
, $switchLeft
, $switchRight
, $label
, myClasses = ""
, classes = $element.attr('class')
, color
, moving
, onLabel = "ON"
, offLabel = "OFF"
, icon = false;
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
if (classes.indexOf(el) >= 0)
myClasses = el;
});
$element.addClass('has-switch');
if ($element.data('on') !== undefined)
color = "switch-" + $element.data('on');
if ($element.data('on-label') !== undefined)
onLabel = $element.data('on-label');
if ($element.data('off-label') !== undefined)
offLabel = $element.data('off-label');
if ($element.data('icon') !== undefined)
icon = $element.data('icon');
$switchLeft = $('<span>')
.addClass("switch-left")
.addClass(myClasses)
.addClass(color)
.html(onLabel);
color = '';
if ($element.data('off') !== undefined)
color = "switch-" + $element.data('off');
$switchRight = $('<span>')
.addClass("switch-right")
.addClass(myClasses)
.addClass(color)
.html(offLabel);
$label = $('<label>')
.html("&nbsp;")
.addClass(myClasses)
.attr('for', $element.find('input').attr('id'));
if (icon) {
$label.html('<i class="icon icon-' + icon + '"></i>');
}
$div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
if ($element.data('animated') !== false)
$div.addClass('switch-animate').data('animated', true);
$div
.append($switchLeft)
.append($label)
.append($switchRight);
$element.find('>div').addClass(
$element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
);
if ($element.find('input').is(':disabled'))
$(this).addClass('deactivate');
var changeStatus = function ($this) {
$this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
};
$element.on('keydown', function (e) {
if (e.keyCode === 32) {
e.stopImmediatePropagation();
e.preventDefault();
changeStatus($(e.target).find('span:first'));
}
});
$switchLeft.on('click', function (e) {
changeStatus($(this));
});
$switchRight.on('click', function (e) {
changeStatus($(this));
});
$element.find('input').on('change', function (e) {
var $this = $(this)
, $element = $this.parent()
, thisState = $this.is(':checked')
, state = $element.is('.switch-off');
e.preventDefault();
$element.css('left', '');
if (state === thisState) {
if (thisState)
$element.removeClass('switch-off').addClass('switch-on');
else $element.removeClass('switch-on').addClass('switch-off');
if ($element.data('animated') !== false)
$element.addClass("switch-animate");
$element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
}
});
$element.find('label').on('mousedown touchstart', function (e) {
var $this = $(this);
moving = false;
e.preventDefault();
e.stopImmediatePropagation();
$this.closest('div').removeClass('switch-animate');
if ($this.closest('.switch').is('.deactivate'))
$this.unbind('click');
else {
$this.on('mousemove touchmove', function (e) {
var $element = $(this).closest('.switch')
, relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
, percent = (relativeX / $element.width()) * 100
, left = 25
, right = 75;
moving = true;
if (percent < left)
percent = left;
else if (percent > right)
percent = right;
$element.find('>div').css('left', (percent - right) + "%")
});
$this.on('click touchend', function (e) {
var $this = $(this)
, $target = $(e.target)
, $myCheckBox = $target.siblings('input');
e.stopImmediatePropagation();
e.preventDefault();
$this.unbind('mouseleave');
if (moving)
$myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
moving = false;
$myCheckBox.trigger('change');
});
$this.on('mouseleave', function (e) {
var $this = $(this)
, $myCheckBox = $this.siblings('input');
e.preventDefault();
e.stopImmediatePropagation();
$this.unbind('mouseleave');
$this.trigger('mouseup');
$myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
});
$this.on('mouseup', function (e) {
e.stopImmediatePropagation();
e.preventDefault();
$(this).unbind('mousemove');
});
}
});
}
);
},
toggleActivation: function () {
$(this).toggleClass('deactivate');
},
isActive: function () {
return !$(this).hasClass('deactivate');
},
setActive: function (active) {
if (active)
$(this).removeClass('deactivate');
else $(this).addClass('deactivate');
},
toggleState: function (skipOnChange) {
var $input = $(this).find('input:checkbox');
$input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
},
setState: function (value, skipOnChange) {
$(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
},
status: function () {
return $(this).find('input:checkbox').is(':checked');
},
destroy: function () {
var $div = $(this).find('div')
, $checkbox;
$div.find(':not(input:checkbox)').remove();
$checkbox = $div.children();
$checkbox.unwrap().unwrap();
$checkbox.unbind('change');
return $checkbox;
}
};
if (methods[method])
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
else if (typeof method === 'object' || !method)
return methods.init.apply(this, arguments);
else
$.error('Method ' + method + ' does not exist!');
};
}(jQuery);
$(function () {
$('.switch')['bootstrapSwitch']();
});

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,44 @@
(function(w, undefined) {
var firstNames = ['Elodia', 'Sephnie', 'Maxine', 'Claudine', 'Londa', 'Gwyn', 'Consuelo', 'Mariko', 'Lashanda', 'Jesusa', 'Bernie', 'Annamaria', 'Muriel', 'Nikia', 'Margene', 'Lorraine', 'Annemarie', 'Rayna', 'Anonina', 'Carie', 'Gran', 'Jua', 'Jacqulyn', 'Whiney', 'Renaa', 'Usha', 'Annea', 'Jack', 'Chun', 'Eddy', 'Isidra', 'Myesha', 'Ami', 'Easer', 'Karon', 'Granville', 'Maria', 'Shenia', 'Solomon', 'Marquia', 'Charles', 'Neie', 'Beariz', 'Humbero', 'Rigobero', 'Lamon', 'Rivka', 'Phoebe', 'Renea', 'Celia', 'Shay', 'Sanford', 'Gwen', 'Lizzee', 'Lucila', 'Alice', 'Lauri', 'Desmond', 'Raeann', 'Rona', 'Jason', 'Lilian', 'Karena', 'Dennise', 'Delana', 'Rheba', 'Doy', 'Dolly', 'Venice', 'Dalene', 'Cyndy', 'Ilona', 'Lakeshia', 'Laurena', 'Lorriane', 'Kaci', 'Velve', 'Maple', 'Maire', 'Marline', 'Bar', 'Nelly', 'Shona', 'Karole', 'Judi', 'Ardelia', 'Alonzo', 'Junie', 'Alvina', 'Ilda'];
var lastNames = ['Ortego', 'Landa', 'Piermarini', 'Valles', 'Lusher', 'Branco', 'Falls', 'Hallett', 'Nicley', 'Cambareri', 'Han', 'Edwin', 'Lan', 'Dauenhauer', 'Cerrone', 'Matsumura', 'Mosher', 'Dragoo', 'Robare', 'Judon', 'Kyger', 'Bonk', 'Mcgaughy', 'Mcfetridge', 'Maxton', 'Roling', 'Klotz', 'Boudreaux', 'Hayton', 'Leonardo', 'Schug', 'Dewitt', 'Wohlwend', 'Hoos', 'Pennock', 'Sprinkle', 'Weick', 'Gilliland', 'Resler', 'Badgett', 'Bittinger', 'Letts', 'Bottom', 'Hibler', 'Fuhrman', 'Lewis', 'Moudy', 'Goyette', 'Difranco', 'Kyles', 'Sluss', 'Bruening', 'Halladay', 'Leinen', 'Leister', 'Morgado', 'Wadkins', 'Yingst', 'Hyland', 'Carasco', 'Stever', 'Weisz', 'Woldt', 'Leak', 'Sinclair', 'Heinen', 'Furniss', 'Hosler', 'Shumpert', 'Keasler', 'Stgelais', 'Landers', 'Hogle', 'Ates', 'Vanatta', 'Goodlow', 'Haner', 'Yaple', 'Lamark', 'Cataldo', 'Smelcer', 'Marco', 'Quaranta', 'Cooke', 'Ardrey', 'Guilford', 'Polo', 'Sprouse', 'Gaffney', 'Lafromboise'];
var jobTitles = ['Language Translator', 'Propeller-Driven Airplane Mechanic', 'Work Ticket Distributor', 'Pipe Organ Technician', 'LAN Systems Administrator', 'Employment Clerk', 'Electrical Lineworker', 'Serials Librarian', 'Technical Services Librarian', 'Blackjack Supervisor', 'Pulpwood Cutter', 'Military Science Teacher', 'Missile Pad Mechanic', 'Psychology Professor', 'Scene and Lighting Design Lecturer', 'Internet Marketing Manager', 'Business Services Sales Representative', 'Assistant Corporation Counsel', 'Photocopying Equipment Repairer', 'Post-Anesthesia Care Unit Nurse', 'Animal Husbandry Manager', 'Electrical Engineering Director', 'Drag Car Racer', 'Auto Detailer', 'Childrens Pastor', 'Strawberry Sorter', 'Geophysicist', 'Financial Accountant', 'Crown and Bridge Technician', 'Jig Bore Tool Maker', 'Union Representative', 'High School Librarian', 'High School History Teacher', 'Beveling and Edging Machine Operator', 'Roller Skater', 'Wallpaperer Helper', 'Childcare Center Administrator', 'Ordnance Engineer', 'Industrial Waste Treatment Technician', 'Airline Transport Pilot', 'Window Trimmer', 'Garment Presser', 'State Archivist', 'Die Designer', 'Ventriloquist', 'Calculus Professor', 'Technical Writer', 'Meat Packager', 'Automobile Body Painter', 'Aircraft Landing Gear Inspector', 'Fashion Designer', 'Drywall Stripper', 'Clown', 'National Association for Stock Car Auto Racing Driver', 'Staff Electronic Warfare Officer', 'Hydroelectric Machinery Mechanic', 'Clinical Services Director', 'Traffic Court Referee', 'Internal Medicine Nurse Practitioner', 'Horticulture Instructor', 'Ships Electronic Warfare Officer', 'Broadcast Maintenance Engineer', 'Weight Training Instructor', 'Potato Sorter', 'Appliance Parts Counter Clerk', 'Body Shop Supervisor', 'Accounts Collector', 'Commercial Lender', 'Scale Clerk', 'Obstetrician/Gynecologist', 'Gaming Cage Cashier', 'Fresco Artist', 'Youth Pastor', 'Parachute Officer', 'Geophysical Engineer', 'Route Sales Person', 'Master of Ceremonies', 'Cloak Room Attendant', 'Gas Main Fitter', 'Religious Activities Director', 'Hemodialysis Technician', 'Telephone Lines Repairer', 'Periodontist', 'Wood Fence Installer', 'Offbearer', 'Aviation Tactical Readiness Officer', 'Biology Laboratory Assistant', 'Emergency Room Orderly', 'Magician', 'Dog Trainer'];
var statuses = [{ 'name': 'Active', 'value': 1 }, { 'name': 'Disabled', 'value': 2 }, { 'name': 'Suspended', 'value': 3 }];
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
function randomDate() {
var start = new Date(1960, 0, 1), end = new Date(1994, 0, 1);
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
}
w.generateRows = function(rows, extraCols, return_rows) {
rows = rows || 100;
extraCols = extraCols || 0;
return_rows = return_rows || false;
var output = '';
for (var i = 0; i < rows; i++) {
var data = {
firstName: firstNames[Math.floor(Math.random() * firstNames.length)],
lastName: lastNames[Math.floor(Math.random() * lastNames.length)],
jobTitle: jobTitles[Math.floor(Math.random() * jobTitles.length)],
status: statuses[Math.floor(Math.random() * statuses.length)],
dob: randomDate()
};
var row = '<tr>';
//row += '<td class="expand"></td>';
row += '<td>' + data.firstName + '</td>';
row += '<td>' + data.lastName + '</td>';
row += '<td>' + data.jobTitle + '</td>';
row += '<td data-value="' + data.dob.getTime() + '">' + data.dob.getDate() + ' ' + months[data.dob.getMonth()] + ' ' + data.dob.getFullYear() +'</td>';
row += '<td data-value="' + data.status.value + '">' + data.status.name + '</td>';
for (var j = 0; j < extraCols; j++) {
row += '<td>' + (i+1) + '.' + (j+1) + '</td>';
}
row += '</tr>';
if (!return_rows) document.writeln(row);
else
output += row;
}
if (return_rows) return output;
};
})(window);

View File

@ -0,0 +1,153 @@
<?php
/**
*
*@version 2.0.0 - September 03, 2014
*@package Component Builder
*@author Llewellyn van de Merwe <http://www.vdm.io>
*@copyright Copyright (C) 2014. All Rights Reserved
*@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
**/
// 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');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Download Controller
*/
class ###Component###ControllerDownload extends JControllerLegacy
{
public function __construct($config)
{
parent::__construct($config);
// load the tasks
$this->registerTask('file', 'download');
}
public function download()
{
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
$userAllowed = $jinput->get('key', NULL, 'INT');
if($user->id != 0 && $userAllowed == $user->id && $token == $call_token)
{
$task = $this->getTask();
switch($task)
{
case 'file':
$enUrl = $jinput->get('link', NULL, 'BASE64');
$filename = $jinput->get('filename', NULL, 'CMD');
if(base64_encode(base64_decode($enUrl, true)) === $enUrl && $filename)
{
// Get local key
$localkey = md5(JComponentHelper::getParams('com_###component###')->get('basic_key', 'localKey34fdWEkl'));
$opener = new FOFEncryptAes($localkey, 256);
$link = rtrim($opener->decryptString(base64_decode($enUrl)));
$info = $this->getContentInfo($link);
// set headers
if (isset($info['type']) && $info['type'])
{
header('Content-Type: '.$info['type']);
}
elseif (strpos($filename, '.mp3') !== false)
{
header('Content-Type: audio/mpeg');
}
else
{
header('Content-Type: application/octet-stream');
}
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . $filename . "\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
if (isset($info['filesize']) && $info['filesize'])
{
header('Content-Length: ' . $info['filesize']);
}
ob_clean();
flush();
// this is faster but expose the dropbox url
// header("Location: $link");
// this is slower but better much more secure
readfile($link);
jexit();
}
break;
}
}
return false;
}
protected function getContentInfo($url)
{
// we first try the curl option
if ($this->_isCurl())
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
curl_close($ch);
}
else
{
// then we try getheaders (this is slower)
stream_context_set_default( array('http' => array('method' => 'HEAD')));
$headers = get_headers($url);
if (###Component###Helper::checkArray($headers))
{
$data = implode("\n", $headers);
}
}
// get the Content Length
if (preg_match('/Content-Length: (\d+)/', $data, $matches))
{
// Contains file size in bytes
$found['filesize'] = (int)$matches[1];
}
// get the Content Type
if (preg_match_all('/Content-Type: (.+)/', $data, $matches))
{
foreach ($matches[1] as $match)
{
// not the html
if (strpos( $match, 'text/html') === false)
{
$found['type'] = $match;
break;
}
}
}
// return found values
if (isset($found) && ###Component###Helper::checkArray($found))
{
return $found;
}
return false;
}
protected function _isCurl()
{
return function_exists('curl_version');
}
}

View File

@ -0,0 +1,171 @@
<?php
/**
*
*@version 2.0.0 - September 03, 2014
*@package Component Builder
*@author Llewellyn van de Merwe <http://www.vdm.io>
*@copyright Copyright (C) 2014. All Rights Reserved
*@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
**/
// 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');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Download Controller
*/
class ###Component###ControllerDownload extends JControllerLegacy
{
public function __construct($config)
{
parent::__construct($config);
// load the tasks
$this->registerTask('file', 'download');
}
public function download()
{
$jinput = JFactory::getApplication()->input;
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token)
{
$task = $this->getTask();
switch($task)
{
case 'file':
$keys = ###Component###Helper::base64_urldecode($jinput->get('key', NULL, 'STRING'));
$enUrl = ###Component###Helper::base64_urldecode($jinput->get('link', NULL, 'STRING'));
$filename = $jinput->get('filename', NULL, 'CMD');
if((base64_encode(base64_decode($enUrl, true)) === $enUrl) && (base64_encode(base64_decode($keys, true)) === $keys) && $filename)
{
// we must first count this download
if (###Component###Helper::countDownload($keys,$filename))
{
// get Site name
$config = JFactory::getConfig();
$vendor = $config->get('sitename');
$name = ###Component###Helper::safeString($filename, 'Ww');
// Get local key
$localkey = ###Component###Helper::getLocalKey();
$opener = new FOFEncryptAes($localkey, 128);
$link = rtrim($opener->decryptString($enUrl), "\0");
$info = $this->getContentInfo($link);
// set headers
$app = JFactory::getApplication();
$app->setHeader('Accept-ranges', 'bytes', true);
$app->setHeader('Connection', 'keep-alive', true);
$app->setHeader('Content-Encoding', 'none', true);
$app->setHeader('Content-disposition', 'attachment; filename="'.$filename.'";', true);
if (isset($info['type']) && $info['type'])
{
$app->setHeader('Content-Type', $info['type'], true);
}
elseif (strpos($filename, '.mp3') !== false)
{
$app->setHeader('Content-Type', 'audio/mpeg', true);
}
else
{
$app->setHeader('Content-Type', 'application/octet-stream', true);
}
// important to have the file size.
if (isset($info['filesize']) && $info['filesize'])
{
$app->setHeader('Content-Length', (int) $info['filesize'], true);
$app->setHeader('Content-Size', (int) $info['filesize'], true);
}
$app->setHeader('Content-security-policy', 'referrer no-referrer', true);
$app->setHeader('Content-Name', '"'.$name.'"', true);
$app->setHeader('Content-Version', '1.0', true);
$app->setHeader('Content-Vendor', '"'.$vendor.'"', true);
$app->setHeader('Content-URL', '"'.JUri::getInstance().'"', true);
$app->setHeader('etag', md5($enUrl), true);
$app->setHeader('Pragma', 'public', true);
$app->setHeader('cache-control', 'max-age=0', true);
$app->setHeader('x-robots-tag', 'noindex, nofollow, noimageindex', true);
$app->setHeader('x-content-security-policy', 'referrer no-referrer', true);
$app->setHeader('x-webkit-csp', 'referrer no-referrer', true);
$app->setHeader('x-content-security-policy', 'referrer no-referrer', true);
// get the file
readfile($link);
$app->sendHeaders();
$app->close();
jexit();
}
}
break;
}
}
die('Restricted access');
}
protected function getContentInfo($url)
{
// we first try the curl option
if ($this->_isCurl())
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
curl_close($ch);
}
else
{
// then we try getheaders (this is slower)
stream_context_set_default( array('http' => array('method' => 'HEAD')));
$headers = get_headers($url);
if (###Component###Helper::checkArray($headers))
{
$data = implode("\n", $headers);
}
}
// get the Content Length
if (preg_match('/Content-Length: (\d+)/', $data, $matches))
{
// Contains file size in bytes
$found['filesize'] = (int) $matches[1];
}
// get the Content Type
if (preg_match_all('/Content-Type: (.+)/', $data, $matches))
{
foreach ($matches[1] as $match)
{
// not the html
if (strpos( $match, 'text/html') === false)
{
$found['type'] = $match;
break;
}
}
}
// return found values
if (isset($found) && ###Component###Helper::checkArray($found))
{
return $found;
}
return false;
}
protected function _isCurl()
{
return function_exists('curl_version');
}
}

451
admin/custom/dropbox.php Normal file
View File

@ -0,0 +1,451 @@
<?php
/*----------------------------------------------------------------------------------| www.vdm.io |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0 - 03rd November, 2016
@package Dropbox API 2
@subpackage dropbox.php
@author Llewellyn 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
/------------------------------------------------------------------------------------------------------*/
// No direct access.
defined('_JEXEC') or die;
/**
* Dropbox class
*/
class Dropbox
{
/**
* final url
*/
protected $url;
/**
* The array for the post url
*/
protected $postUrl = array(
"protocol" => "https://",
"suddomain" => "api.",
"domain" => "dropboxapi.com",
"path" => "/2/"
);
/**
* the verious pathes we need
*/
protected $domainpath = array(
"list_folder" => "files/list_folder",
"list_folder_continue" => "files/list_folder/continue",
"create_shared_link" => "sharing/create_shared_link",
"get_shared_link_metadata" => "sharing/get_shared_link_metadata",
"revoke" => "auth/token/revoke"
);
/**
* the target pathe to get
*/
protected $targetPath = false;
protected $targetPathOriginal = false;
/**
* oauth token
*/
protected $oauthToken;
/**
* the verious pathes we need
*/
protected $permissionType;
/**
* The loop controller in calling Dropbox API
*/
protected $continueCalling = array();
/**
* the success switch
*/
protected $succes;
/**
* the type call
*/
protected $type;
/**
* the query for the call
*/
protected $query;
/**
* the query for the call
*/
protected $model;
/**
* the mediaData bucket
*/
public $mediaData = array();
/**
* the error messages
*/
public $error_summary = array();
/**
* Constructor
*/
public function __construct(JModelLegacy $model, $buildType)
{
// set the url at this point for now
$this->url = $this->postUrl["protocol"].$this->postUrl["suddomain"].$this->postUrl["domain"].$this->postUrl["path"];
// set the local model
$this->model = $model;
// set the build type
$this->build = (int) $buildType;
}
/**
* getFiles
*
* =============
* $details
* =============
* dropboxOption
* dropboxTarget
* addTypes
*
*/
public function getFiles($token, $permissiontype, $details = array())
{
// we need more then the normal time to run this script 5 minutes at least.
ini_set('max_execution_time', 500);
// set the oauth toke
$this->oauthToken = $token;
// set the permission type
$this->permissionType = $permissiontype;
// set the details
if ($this->checkArray($details))
{
foreach ($details as $detail => $value)
{
$this->$detail = $value;
}
}
// set the curent folder path
if (!$this->setFolderPath())
{
return false;
}
// start the main factory that calles for the folder data
$this->query = array("path" => $this->targetPath, "recursive" => true, "include_media_info" => true);
$this->type = 'list_folder';
if ($this->makeCall())
{
return true;
}
}
public function revokeToken($token = null)
{
if ($token)
{
// set the oauth toke
$this->oauthToken = $token;
}
// set the call to revoke the token
$this->query = 'null';
$this->type = 'revoke';
if ($this->makeCall())
{
return true;
}
return false;
}
protected function setFolderPath()
{
if ('full' == $this->permissionType && isset($this->dropboxOption) && isset($this->dropboxTarget) && $this->checkString($this->dropboxTarget))
{
if (2 == $this->dropboxOption)
{
// simply set the path
$this->targetPath = '/'.trim(strtolower($this->dropboxTarget), '/');
return true;
}
elseif (1 == $this->dropboxOption)
{
// make a call to get the path
$this->query = array("url" => $this->dropboxTarget);
$this->type = 'get_shared_link_metadata';
if ($this->makeCall())
{
return true;
}
}
}
elseif ('app' == $this->permissionType)
{
$this->targetPath = "";
return true;
}
return false;
}
protected function makeCall()
{
if ($this->_isCurl())
{
return $this->makeCurlCall();
}
else
{
return $this->makeGetCall();
}
}
protected function makeGetCall()
{
$query = json_encode($this->query);
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n".
"Authorization: Bearer ".$this->oauthToken,
'method' => "POST",
'content' => $query
),
);
$context = stream_context_create($options);
$response = file_get_contents($this->url.$this->domainpath[$this->type], false, $context);
if ($response === FALSE)
{
$this->error_summary[] = $this->type.'_error';
return false;
}
else
{
// store the result
return $this->setTheResult(json_decode($response));
}
}
protected function makeCurlCall()
{
$query = json_encode($this->query);
$headers = array('Authorization: Bearer '. $this->oauthToken,
'Content-Type: application/json'
);
$ch = curl_init($this->url.$this->domainpath[$this->type]);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_VERBOSE, 1); // debug
$response = curl_exec($ch);
curl_close($ch);
if ($this->checkJson($response))
{
$response = json_decode($response);
}
// store the result
return $this->setTheResult($response);
}
protected function setTheResult($data)
{
// if there was an error stop!!!
if (isset($data->error_summary))
{
$this->error_summary[] = $data->error_summary;
return false;
}
// deal with each type
switch ($this->type)
{
case "list_folder":
case "list_folder_continue":
if (isset($data->entries) && $this->checkArray($data->entries))
{
if ($this->storeFiles($data->entries))
{
// run the continue if needed
if (isset($data->has_more) && $data->has_more && isset($data->cursor))
{
// start the main factory that calles for the folder data
$this->query = array("cursor" => $data->cursor);
$this->type = 'list_folder_continue';
if ($this->makeCall())
{
return true;
}
}
return true;
}
}
$this->error_summary[] = $this->type.'_error';
break;
case "create_shared_link":
if (isset($data->url) && isset($data->path) && $this->storeSharedLink($this->fixPath($data->path), str_replace('?dl=0','?dl=1',$data->url)))
{
// we stored the link
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
case "get_shared_link_metadata":
if (isset($data->path_lower))
{
$this->targetPath = $data->path_lower;
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
case "revoke":
if (is_null($data))
{
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
}
return false;
}
protected function storeSharedLink($path, $url)
{
// we need to store the url to DB
if (isset($this->mediaData[$path]))
{
$localListing = array();
$localListing['id'] = 0;
$localListing['name'] = $this->mediaData[$path]['name'];
$localListing['size'] = $this->mediaData[$path]['size'];
$localListing['key'] = $path;
$localListing['url'] = $url;
$localListing['build'] = $this->build;
// free some memory
unset($this->mediaData[$path]);
// check if item already set
if ($id = $this->model->searchForId($path))
{
// update item
$localListing['id'] = $id;
}
return $this->model->save($localListing);
}
return false;
}
protected function storeFiles($entries)
{
foreach ($entries as $item)
{
if (isset($item->{'.tag'}) && 'file' == $item->{'.tag'} && isset($item->name))
{
$addLink = false;
// remove if not related to type
if (isset($this->addTypes) && $this->checkArray($this->addTypes))
{
foreach ($this->addTypes as $add)
{
if (strpos($item->name,$add) !== false)
{
$addLink = true;
}
}
}
if ($addLink && isset($item->path_lower))
{
// store media info
$this->mediaData[$this->fixPath($item->path_lower)] = array('name' => $item->name, 'size' => $item->size);
// get the shared link
$this->query = array("path" => $item->path_lower);
$this->type = 'create_shared_link';
if (!$this->makeCall())
{
return false;
}
}
}
}
return true;
}
protected function fixPath($path)
{
if ($this->checkString($this->targetPath))
{
$path = str_replace($this->targetPath, 'VDM_pLeK_h0uEr', $path);
}
else
{
$path = 'VDM_pLeK_h0uEr'.$path;
}
return $path;
}
protected function checkObject($object)
{
if (isset($object) && is_object($object) && count($object) > 0)
{
return true;
}
return false;
}
protected function checkArray($array)
{
if (isset($array) && is_array($array) && count($array) > 0)
{
return true;
}
return false;
}
protected function checkJson($string)
{
if ($this->checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
protected function checkString($string)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
}
protected function _isCurl()
{
return function_exists('curl_version');
}
}

View File

@ -0,0 +1,445 @@
<?php
/**
*
*@version 2.0.0 - September 03, 2014
*@package Component Builder
*@author Llewellyn van de Merwe <http://www.vdm.io>
*@copyright Copyright (C) 2014. All Rights Reserved
*@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
**/
// 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');
/**
* Dropbox updater component helper
*/
class Dropboxupdater
{
/**
* update flag (if false update will not happen)
**/
protected $okay = true;
/**
* update flag (if false update will not happen)
**/
protected $data = null;
/**
* the file Key
**/
protected $fileKey;
/**
* allow a forced update
**/
protected $forceUpdate;
/**
* Todays date-time
**/
protected $today;
/**
* Next updat date-time
**/
protected $next;
/**
* update method
**/
protected $updateMethod;
/**
* update targets
**/
protected $updateTarget;
/**
* info related to this update
**/
protected $updateInfo;
protected $infoFilePath;
/**
* get the localkey
**/
protected $localkey = false;
/**
* Main dropbox class
**/
protected $dropbox;
/**
* component parameters
**/
protected $app_params;
/**
* the errors
**/
protected $errors = array();
/**
* everything we want done when initialized
**/
public function __construct()
{
// get params
$this->app_params = JComponentHelper::getParams('com_###component###');
}
/**
* get the logged errors array
**/
public function getErrors()
{
return $this->errors;
}
/**
* set the error to the log
**/
protected function setErrors($error)
{
if (###Component###Helper::checkString($error))
{
$this->errors[] = $error;
}
elseif (###Component###Helper::checkArray($error))
{
foreach($error as $log)
{
if (###Component###Helper::checkString($log))
{
$this->errors[] = $log;
}
}
}
}
/**
* update method
**/
public function update($id, $target, $type = false, $forceUpdate = false, $sleutel = null)
{
if ($type)
{
// start fresh
$this->okay = true;
$this->data = null;
// is this a forced run
$this->forceUpdate = $forceUpdate;
// the file key
$this->fileKey = ###Component###Helper::safeString($id.$target.$type);
// set the type of this listing
$this->type = $type;
// get the external source data being updated
$this->setExternalSourceData($id);
// load the token if manualy set
if ($sleutel)
{
$this->setExternalSourceData($id, array('oauthtoken' => $sleutel));
}
// what update method is set
$this->setUpdateMethod();
// set the update links
$this->setUpdateTarget($target);
// set needed dates
if ($this->okay)
{
$this->setDates();
}
// get info data or set if not found
if ($this->okay)
{
$this->setUpdateInfoData();
}
// check if update should run now
if ($this->okay)
{
$this->checkUpdateStatus();
}
// before update save update info incase class is called again
if($this->okay)
{
if ($this->updateInfo->updatenow)
{
// turn update to active
$this->updateInfo->updatenow = false;
$this->updateInfo->updateactive = true;
// now save the date
$this->okay = $this->saveUpdateInfo();
}
else
{
$this->okay = false;
}
}
// run the update if all is okay
if ($this->okay)
{
// set the config
$this->setDetailsConfig();
// load the file
JLoader::import('dropbox', JPATH_COMPONENT_SITE.'/helpers');
$build = 1;
if ('auto' == $this->type)
{
$build = 2;
}
// load the dropbox class
$this->dropbox = new Dropbox(###Component###Helper::getModel('local_listing', JPATH_COMPONENT_ADMINISTRATOR), $build);
// okay now update
$this->okay = $this->doUpdate();
}
// always reset if all okay
return $this->resetUpdate();
}
$this->setErrors('The update type is unknown.');
return false;
}
/**
* set the exsternal source data
*/
protected function setExternalSourceData($id, $data = array())
{
// get the data if not set
if (!$this->data || !###Component###Helper::checkObject($this->data))
{
// load model to get the data
$model = ###Component###Helper::getModel('external_source', JPATH_COMPONENT_ADMINISTRATOR);
$this->data = $model->getItem($id);
}
// if new data is set load it
if (###Component###Helper::checkArray($data))
{
foreach ($data as $key => $value)
{
$this->data->$key = $value;
}
}
}
/**
* set update mehtod
**/
protected function setUpdateMethod()
{
if ($this->forceUpdate)
{
// this is a manual method
$this->updateMethod = 'manual';
}
elseif (2 == $this->data->update_method)
{
// this it an auto mehtod
$this->updateMethod = 'auto';
}
else
{
$this->okay = false;
}
}
/**
* set update target
**/
protected function setUpdateTarget($nr)
{
// get target based on type and position
if ('full' == $this->data->permissiontype && $nr > 0)
{
$position = $nr - 1;
if (1 == $this->data->dropboxoptions && ###Component###Helper::checkJson($this->data->sharedurl))
{
$targets = json_decode($this->data->sharedurl)->tsharedurl;
}
elseif (2 == $this->data->dropboxoptions && ###Component###Helper::checkJson($this->data->folder))
{
$targets = json_decode($this->data->folder)->tfolder;
}
// check if we found any
if (!isset($targets[$position]) || !###Component###Helper::checkString($targets[$position]))
{
$this->setErrors('The target Shared-url or Folder is not set.');
$this->okay = false;
}
else
{
$this->updateTarget = $targets[$position];
}
}
else
{
$this->updateTarget = '';
}
}
/**
* set the configeration for exsternal source class
**/
protected function setDetailsConfig()
{
// reset config
$this->detailsConfig = array();
// get the legal files set
$this->detailsConfig['addTypes'] = $this->data->filetypes;
// set other config settings
$this->detailsConfig['dropboxOption'] = $this->data->dropboxoptions;
// set dropbox target
$this->detailsConfig['dropboxTarget'] = $this->updateTarget;
}
/**
* set next update time
**/
protected function setDates()
{
// set todays date/time
$this->today = time();
// set the next update date/time
if ('manual' == $this->updateMethod)
{
// set the date to two days ago to ensure the update runs now
$this->next = strtotime("-2 days");
}
else
{
// based on the auto time we will set the next update date/time
$timer = $this->data->update_timer;
if ($timer != 0)
{
// Get Next Update Time
$this->next = strtotime('+'.$timer.' minutes', $this->today);
}
// if timer is 0 we should not update
else
{
$this->setErrors('The timer is not setup correctly.');
$this->okay = false;
}
}
}
/**
* set update info data
**/
protected function setUpdateInfoData()
{
// set the info file name
$fileName = md5($this->fileKey.'info'.$this->localkey);
// set file path
$this->infoFilePath = JPATH_COMPONENT_SITE.'/helpers/'.$fileName.'.json';
if (($json = @file_get_contents($this->infoFilePath)) !== FALSE)
{
$this->updateInfo = json_decode($json);
}
else
{
$this->updateInfo = new stdClass;
$this->updateInfo->nextupdate = 0;
$this->updateInfo->updateactive = false;
$this->updateInfo->updatenow = false;
}
}
/**
* check update status
**/
protected function checkUpdateStatus()
{
// check if there is already an update running
if ($this->updateInfo->updateactive)
{
$this->okay = false;
$this->setErrors('There is an update already running.');
}
// check if the time has come to do the next update
elseif (('auto' == $this->updateMethod) && ($this->updateInfo->nextupdate > $this->today))
{
$this->okay = false;
$this->setErrors('It is not yet time to run this update.');
}
else
{
$this->updateInfo->updatenow = true;
}
}
/**
* save the update info
**/
protected function saveUpdateInfo()
{
return $this->saveJson(json_encode($this->updateInfo),$this->infoFilePath);
}
/**
* update the local listing
**/
protected function doUpdate()
{
// we need more then the normal time to run this script 5 minutes at least.
ini_set('max_execution_time', 500);
// get data of all the shared links of all target items
if (!$this->dropbox->getFiles($this->data->oauthtoken, $this->data->permissiontype, $this->detailsConfig))
{
$this->setErrors($this->dropbox->error_summary);
return false;
}
// if this is a manual update, then revoke the token
if ($this->forceUpdate)
{
$this->dropbox->revokeToken($this->data->oauthtoken);
}
return true;
}
protected function resetUpdate()
{
if ($this->okay)
{
// make sure the update reset
$this->updateInfo->nextupdate = $this->next;
$this->updateInfo->updateactive = false;
$this->updateInfo->updatenow = false;
return $this->saveUpdateInfo();
}
return false;
}
protected function saveJson($data,$filename)
{
if (###Component###Helper::checkString($data))
{
$fp = fopen($filename, 'w');
fwrite($fp, $data);
fclose($fp);
return true;
}
return false;
}
}

View File

@ -0,0 +1,50 @@
/*! UIkit 2.0.0 | https://www.getuikit.com | (c) 2013 YOOtheme | MIT License */
(function($, UI){
var FormPassword = function(element, options) {
var $this = this, $element = $(element);
if($element.data("formPassword")) return;
this.options = $.extend({}, FormPassword.defaults, options);
this.element = $element.on("click", function(e) {
e.preventDefault();
if($this.input.length) {
var type = $this.input.attr("type");
$this.input.attr("type", type=="text" ? "password":"text");
$this.element.text($this.options[type=="text" ? "lblShow":"lblHide"]);
}
});
$this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input");
$this.element.text(this.options[$this.input.is("[type='password']") ? "lblShow":"lblHide"]);
this.element.data("formPassword", this);
};
FormPassword.defaults = {
"lblShow": "Show",
"lblHide": "Hide"
};
UI["formPassword"] = FormPassword;
// init code
$(document).on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
var ele = $(this);
if (!ele.data("formPassword")) {
e.preventDefault();
var obj = new FormPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
ele.trigger("click");
}
});
})(jQuery, jQuery.UIkit);

3
admin/custom/form-password.min.js vendored Normal file
View File

@ -0,0 +1,3 @@
/*! UIkit 2.0.0 | https://www.getuikit.com | (c) 2013 YOOtheme | MIT License */
(function(t,e){var n=function(e,i){var s=this,o=t(e);o.data("formPassword")||(this.options=t.extend({},n.defaults,i),this.element=o.on("click",function(t){if(t.preventDefault(),s.input.length){var e=s.input.attr("type");s.input.attr("type","text"==e?"password":"text"),s.element.text(s.options["text"==e?"lblShow":"lblHide"])}}),s.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),s.element.text(this.options[s.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this))};n.defaults={lblShow:"Show",lblHide:"Hide"},e.formPassword=n,t(document).on("click.formpassword.uikit","[data-uk-form-password]",function(i){var s=t(this);s.data("formPassword")||(i.preventDefault(),new n(s,e.Utils.options(s.attr("data-uk-form-password"))),s.trigger("click"))})})(jQuery,jQuery.UIkit);

11
admin/custom/form.js Normal file
View File

@ -0,0 +1,11 @@
jQuery(document).ready(function() {
jQuery('#tour_favorite').click(function() {
if (jQuery(this).attr('rel') == 'no') {
jQuery('#tour_favorite').removeClass('favorite_inactive')
.addClass('favorite_active').attr('rel', 'yes');
} else {
jQuery('#tour_favorite').removeClass('favorite_active')
.addClass('favorite_inactive').attr('rel', 'no');
};
});
});

BIN
admin/custom/grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

11
admin/custom/iframeheight.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,573 @@
/*!
* MockJax - jQuery Plugin to Mock Ajax requests
*
* Version: 1.5.1
* Released:
* Home: https://github.com/appendto/jquery-mockjax
* Author: Jonathan Sharp (https://jdsharp.com)
* License: MIT,GPL
*
* Copyright (c) 2011 appendTo LLC.
* Dual licensed under the MIT or GPL licenses.
* https://appendto.com/open-source-licenses
*/
(function($) {
var _ajax = $.ajax,
mockHandlers = [],
CALLBACK_REGEX = /=\?(&|$)/,
jsc = (new Date()).getTime();
// Parse the given XML string.
function parseXML(xml) {
if ( window.DOMParser == undefined && window.ActiveXObject ) {
DOMParser = function() { };
DOMParser.prototype.parseFromString = function( xmlString ) {
var doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML( xmlString );
return doc;
};
}
try {
var xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );
if ( $.isXMLDoc( xmlDoc ) ) {
var err = $('parsererror', xmlDoc);
if ( err.length == 1 ) {
throw('Error: ' + $(xmlDoc).text() );
}
} else {
throw('Unable to parse XML');
}
return xmlDoc;
} catch( e ) {
var msg = ( e.name == undefined ? e : e.name + ': ' + e.message );
$(document).trigger('xmlParseError', [ msg ]);
return undefined;
}
}
// Trigger a jQuery event
function trigger(s, type, args) {
(s.context ? $(s.context) : $.event).trigger(type, args);
}
// Check if the data field on the mock handler and the request match. This
// can be used to restrict a mock handler to being used only when a certain
// set of data is passed to it.
function isMockDataEqual( mock, live ) {
var identical = true;
// Test for situations where the data is a querystring (not an object)
if (typeof live === 'string') {
// Querystring may be a regex
return $.isFunction( mock.test ) ? mock.test(live) : mock == live;
}
$.each(mock, function(k) {
if ( live[k] === undefined ) {
identical = false;
return identical;
} else {
if ( typeof live[k] == 'object' ) {
identical = identical && isMockDataEqual(mock[k], live[k]);
} else {
if ( $.isFunction( mock[k].test ) ) {
identical = identical && mock[k].test(live[k]);
} else {
identical = identical && ( mock[k] == live[k] );
}
}
}
});
return identical;
}
// Check the given handler should mock the given request
function getMockForRequest( handler, requestSettings ) {
// If the mock was registered with a function, let the function decide if we
// want to mock this request
if ( $.isFunction(handler) ) {
return handler( requestSettings );
}
// Inspect the URL of the request and check if the mock handler's url
// matches the url for this ajax request
if ( $.isFunction(handler.url.test) ) {
// The user provided a regex for the url, test it
if ( !handler.url.test( requestSettings.url ) ) {
return null;
}
} else {
// Look for a simple wildcard '*' or a direct URL match
var star = handler.url.indexOf('*');
if (handler.url !== requestSettings.url && star === -1 ||
!new RegExp(handler.url.replace(/[-[\]{}()+?.,\\^$|#\s]/g, "\\$&").replace(/\*/g, '.+')).test(requestSettings.url)) {
return null;
}
}
// Inspect the data submitted in the request (either POST body or GET query string)
if ( handler.data && requestSettings.data ) {
if ( !isMockDataEqual(handler.data, requestSettings.data) ) {
// They're not identical, do not mock this request
return null;
}
}
// Inspect the request type
if ( handler && handler.type &&
handler.type.toLowerCase() != requestSettings.type.toLowerCase() ) {
// The request type doesn't match (GET vs. POST)
return null;
}
return handler;
}
// Process the xhr objects send operation
function _xhrSend(mockHandler, requestSettings, origSettings) {
// This is a substitute for < 1.4 which lacks $.proxy
var process = (function(that) {
return function() {
return (function() {
var onReady;
// The request has returned
this.status = mockHandler.status;
this.statusText = mockHandler.statusText;
this.readyState = 4;
// We have an executable function, call it to give
// the mock handler a chance to update it's data
if ( $.isFunction(mockHandler.response) ) {
mockHandler.response(origSettings);
}
// Copy over our mock to our xhr object before passing control back to
// jQuery's onreadystatechange callback
if ( requestSettings.dataType == 'json' && ( typeof mockHandler.responseText == 'object' ) ) {
this.responseText = JSON.stringify(mockHandler.responseText);
} else if ( requestSettings.dataType == 'xml' ) {
if ( typeof mockHandler.responseXML == 'string' ) {
this.responseXML = parseXML(mockHandler.responseXML);
//in jQuery 1.9.1+, responseXML is processed differently and relies on responseText
this.responseText = mockHandler.responseXML;
} else {
this.responseXML = mockHandler.responseXML;
}
} else {
this.responseText = mockHandler.responseText;
}
if( typeof mockHandler.status == 'number' || typeof mockHandler.status == 'string' ) {
this.status = mockHandler.status;
}
if( typeof mockHandler.statusText === "string") {
this.statusText = mockHandler.statusText;
}
// jQuery 2.0 renamed onreadystatechange to onload
onReady = this.onreadystatechange || this.onload;
// jQuery < 1.4 doesn't have onreadystate change for xhr
if ( $.isFunction( onReady ) ) {
if( mockHandler.isTimeout) {
this.status = -1;
}
onReady.call( this, mockHandler.isTimeout ? 'timeout' : undefined );
} else if ( mockHandler.isTimeout ) {
// Fix for 1.3.2 timeout to keep success from firing.
this.status = -1;
}
}).apply(that);
};
})(this);
if ( mockHandler.proxy ) {
// We're proxying this request and loading in an external file instead
_ajax({
global: false,
url: mockHandler.proxy,
type: mockHandler.proxyType,
data: mockHandler.data,
dataType: requestSettings.dataType === "script" ? "text/plain" : requestSettings.dataType,
complete: function(xhr) {
mockHandler.responseXML = xhr.responseXML;
mockHandler.responseText = xhr.responseText;
mockHandler.status = xhr.status;
mockHandler.statusText = xhr.statusText;
this.responseTimer = setTimeout(process, mockHandler.responseTime || 0);
}
});
} else {
// type == 'POST' || 'GET' || 'DELETE'
if ( requestSettings.async === false ) {
// TODO: Blocking delay
process();
} else {
this.responseTimer = setTimeout(process, mockHandler.responseTime || 50);
}
}
}
// Construct a mocked XHR Object
function xhr(mockHandler, requestSettings, origSettings, origHandler) {
// Extend with our default mockjax settings
mockHandler = $.extend(true, {}, $.mockjaxSettings, mockHandler);
if (typeof mockHandler.headers === 'undefined') {
mockHandler.headers = {};
}
if ( mockHandler.contentType ) {
mockHandler.headers['content-type'] = mockHandler.contentType;
}
return {
status: mockHandler.status,
statusText: mockHandler.statusText,
readyState: 1,
open: function() { },
send: function() {
origHandler.fired = true;
_xhrSend.call(this, mockHandler, requestSettings, origSettings);
},
abort: function() {
clearTimeout(this.responseTimer);
},
setRequestHeader: function(header, value) {
mockHandler.headers[header] = value;
},
getResponseHeader: function(header) {
// 'Last-modified', 'Etag', 'content-type' are all checked by jQuery
if ( mockHandler.headers && mockHandler.headers[header] ) {
// Return arbitrary headers
return mockHandler.headers[header];
} else if ( header.toLowerCase() == 'last-modified' ) {
return mockHandler.lastModified || (new Date()).toString();
} else if ( header.toLowerCase() == 'etag' ) {
return mockHandler.etag || '';
} else if ( header.toLowerCase() == 'content-type' ) {
return mockHandler.contentType || 'text/plain';
}
},
getAllResponseHeaders: function() {
var headers = '';
$.each(mockHandler.headers, function(k, v) {
headers += k + ': ' + v + "\n";
});
return headers;
}
};
}
// Process a JSONP mock request.
function processJsonpMock( requestSettings, mockHandler, origSettings ) {
// Handle JSONP Parameter Callbacks, we need to replicate some of the jQuery core here
// because there isn't an easy hook for the cross domain script tag of jsonp
processJsonpUrl( requestSettings );
requestSettings.dataType = "json";
if(requestSettings.data && CALLBACK_REGEX.test(requestSettings.data) || CALLBACK_REGEX.test(requestSettings.url)) {
createJsonpCallback(requestSettings, mockHandler, origSettings);
// We need to make sure
// that a JSONP style response is executed properly
var rurl = /^(\w+:)?\/\/([^\/?#]+)/,
parts = rurl.exec( requestSettings.url ),
remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
requestSettings.dataType = "script";
if(requestSettings.type.toUpperCase() === "GET" && remote ) {
var newMockReturn = processJsonpRequest( requestSettings, mockHandler, origSettings );
// Check if we are supposed to return a Deferred back to the mock call, or just
// signal success
if(newMockReturn) {
return newMockReturn;
} else {
return true;
}
}
}
return null;
}
// Append the required callback parameter to the end of the request URL, for a JSONP request
function processJsonpUrl( requestSettings ) {
if ( requestSettings.type.toUpperCase() === "GET" ) {
if ( !CALLBACK_REGEX.test( requestSettings.url ) ) {
requestSettings.url += (/\?/.test( requestSettings.url ) ? "&" : "?") +
(requestSettings.jsonp || "callback") + "=?";
}
} else if ( !requestSettings.data || !CALLBACK_REGEX.test(requestSettings.data) ) {
requestSettings.data = (requestSettings.data ? requestSettings.data + "&" : "") + (requestSettings.jsonp || "callback") + "=?";
}
}
// Process a JSONP request by evaluating the mocked response text
function processJsonpRequest( requestSettings, mockHandler, origSettings ) {
// Synthesize the mock request for adding a script tag
var callbackContext = origSettings && origSettings.context || requestSettings,
newMock = null;
// If the response handler on the moock is a function, call it
if ( mockHandler.response && $.isFunction(mockHandler.response) ) {
mockHandler.response(origSettings);
} else {
// Evaluate the responseText javascript in a global context
if( typeof mockHandler.responseText === 'object' ) {
$.globalEval( '(' + JSON.stringify( mockHandler.responseText ) + ')');
} else {
$.globalEval( '(' + mockHandler.responseText + ')');
}
}
// Successful response
jsonpSuccess( requestSettings, callbackContext, mockHandler );
jsonpComplete( requestSettings, callbackContext, mockHandler );
// If we are running under jQuery 1.5+, return a deferred object
if($.Deferred){
newMock = new $.Deferred();
if(typeof mockHandler.responseText == "object"){
newMock.resolveWith( callbackContext, [mockHandler.responseText] );
}
else{
newMock.resolveWith( callbackContext, [$.parseJSON( mockHandler.responseText )] );
}
}
return newMock;
}
// Create the required JSONP callback function for the request
function createJsonpCallback( requestSettings, mockHandler, origSettings ) {
var callbackContext = origSettings && origSettings.context || requestSettings;
var jsonp = requestSettings.jsonpCallback || ("jsonp" + jsc++);
// Replace the =? sequence both in the query string and the data
if ( requestSettings.data ) {
requestSettings.data = (requestSettings.data + "").replace(CALLBACK_REGEX, "=" + jsonp + "$1");
}
requestSettings.url = requestSettings.url.replace(CALLBACK_REGEX, "=" + jsonp + "$1");
// Handle JSONP-style loading
window[ jsonp ] = window[ jsonp ] || function( tmp ) {
data = tmp;
jsonpSuccess( requestSettings, callbackContext, mockHandler );
jsonpComplete( requestSettings, callbackContext, mockHandler );
// Garbage collect
window[ jsonp ] = undefined;
try {
delete window[ jsonp ];
} catch(e) {}
if ( head ) {
head.removeChild( script );
}
};
}
// The JSONP request was successful
function jsonpSuccess(requestSettings, callbackContext, mockHandler) {
// If a local callback was specified, fire it and pass it the data
if ( requestSettings.success ) {
requestSettings.success.call( callbackContext, mockHandler.responseText || "", status, {} );
}
// Fire the global callback
if ( requestSettings.global ) {
trigger(requestSettings, "ajaxSuccess", [{}, requestSettings] );
}
}
// The JSONP request was completed
function jsonpComplete(requestSettings, callbackContext) {
// Process result
if ( requestSettings.complete ) {
requestSettings.complete.call( callbackContext, {} , status );
}
// The request was completed
if ( requestSettings.global ) {
trigger( "ajaxComplete", [{}, requestSettings] );
}
// Handle the global AJAX counter
if ( requestSettings.global && ! --$.active ) {
$.event.trigger( "ajaxStop" );
}
}
// The core $.ajax replacement.
function handleAjax( url, origSettings ) {
var mockRequest, requestSettings, mockHandler;
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
origSettings = url;
url = undefined;
} else {
// work around to support 1.5 signature
origSettings.url = url;
}
// Extend the original settings for the request
requestSettings = $.extend(true, {}, $.ajaxSettings, origSettings);
// Iterate over our mock handlers (in registration order) until we find
// one that is willing to intercept the request
for(var k = 0; k < mockHandlers.length; k++) {
if ( !mockHandlers[k] ) {
continue;
}
mockHandler = getMockForRequest( mockHandlers[k], requestSettings );
if(!mockHandler) {
// No valid mock found for this request
continue;
}
// If logging is enabled, log the mock to the console
$.mockjaxSettings.log( mockHandler, requestSettings );
if ( requestSettings.dataType === "jsonp" ) {
if ((mockRequest = processJsonpMock( requestSettings, mockHandler, origSettings ))) {
// This mock will handle the JSONP request
return mockRequest;
}
}
// Removed to fix #54 - keep the mocking data object intact
//mockHandler.data = requestSettings.data;
mockHandler.cache = requestSettings.cache;
mockHandler.timeout = requestSettings.timeout;
mockHandler.global = requestSettings.global;
copyUrlParameters(mockHandler, origSettings);
(function(mockHandler, requestSettings, origSettings, origHandler) {
mockRequest = _ajax.call($, $.extend(true, {}, origSettings, {
// Mock the XHR object
xhr: function() { return xhr( mockHandler, requestSettings, origSettings, origHandler ); }
}));
})(mockHandler, requestSettings, origSettings, mockHandlers[k]);
return mockRequest;
}
// We don't have a mock request, trigger a normal request
return _ajax.apply($, [origSettings]);
}
/**
* Copies URL parameter values if they were captured by a regular expression
* @param {Object} mockHandler
* @param {Object} origSettings
*/
function copyUrlParameters(mockHandler, origSettings) {
//parameters aren't captured if the URL isn't a RegExp
if (!mockHandler.url instanceof RegExp) {
return;
}
//if no URL params were defined on the handler, don't attempt a capture
if (!mockHandler.hasOwnProperty('urlParams')) {
return;
}
var captures = mockHandler.url.exec(origSettings.url);
//the whole RegExp match is always the first value in the capture results
if (captures.length === 1) {
return;
}
captures.shift();
//use handler params as keys and capture resuts as values
var i = 0,
capturesLength = captures.length,
paramsLength = mockHandler.urlParams.length,
//in case the number of params specified is less than actual captures
maxIterations = Math.min(capturesLength, paramsLength),
paramValues = {};
for (i; i < maxIterations; i++) {
var key = mockHandler.urlParams[i];
paramValues[key] = captures[i];
}
origSettings.urlParams = paramValues;
}
// Public
$.extend({
ajax: handleAjax
});
$.mockjaxSettings = {
//url: null,
//type: 'GET',
log: function( mockHandler, requestSettings ) {
if ( mockHandler.logging === false ||
( typeof mockHandler.logging === 'undefined' && $.mockjaxSettings.logging === false ) ) {
return;
}
if ( window.console && console.log ) {
var message = 'MOCK ' + requestSettings.type.toUpperCase() + ': ' + requestSettings.url;
var request = $.extend({}, requestSettings);
if (typeof console.log === 'function') {
console.log(message, request);
} else {
try {
console.log( message + ' ' + JSON.stringify(request) );
} catch (e) {
console.log(message);
}
}
}
},
logging: true,
status: 200,
statusText: "OK",
responseTime: 500,
isTimeout: false,
contentType: 'text/plain',
response: '',
responseText: '',
responseXML: '',
proxy: '',
proxyType: 'GET',
lastModified: null,
etag: '',
headers: {
etag: 'IJF@H#@923uf8023hFO@I#H#',
'content-type' : 'text/plain'
}
};
$.mockjax = function(settings) {
var i = mockHandlers.length;
mockHandlers[i] = settings;
return i;
};
$.mockjaxClear = function(i) {
if ( arguments.length == 1 ) {
mockHandlers[i] = null;
} else {
mockHandlers = [];
}
};
$.mockjax.handler = function(i) {
if ( arguments.length == 1 ) {
return mockHandlers[i];
}
};
})(jQuery);

7
admin/custom/marked.js Normal file

File diff suppressed because one or more lines are too long

536
admin/custom/mustache.js Normal file
View File

@ -0,0 +1,536 @@
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* https://github.com/janl/mustache.js
*/
/*global define: false*/
(function (root, factory) {
if (typeof exports === "object" && exports) {
factory(exports); // CommonJS
} else {
var mustache = {};
factory(mustache);
if (typeof define === "function" && define.amd) {
define(mustache); // AMD
} else {
root.Mustache = mustache; // <script>
}
}
}(this, function (mustache) {
var whiteRe = /\s*/;
var spaceRe = /\s+/;
var nonSpaceRe = /\S/;
var eqRe = /\s*=/;
var curlyRe = /\s*\}/;
var tagRe = /#|\^|\/|>|\{|&|=|!/;
// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
// See https://github.com/janl/mustache.js/issues/189
var RegExp_test = RegExp.prototype.test;
function testRegExp(re, string) {
return RegExp_test.call(re, string);
}
function isWhitespace(string) {
return !testRegExp(nonSpaceRe, string);
}
var Object_toString = Object.prototype.toString;
var isArray = Array.isArray || function (obj) {
return Object_toString.call(obj) === '[object Array]';
};
function escapeRegExp(string) {
return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
}
var entityMap = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
function escapeHtml(string) {
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}
function Scanner(string) {
this.string = string;
this.tail = string;
this.pos = 0;
}
/**
* Returns `true` if the tail is empty (end of string).
*/
Scanner.prototype.eos = function () {
return this.tail === "";
};
/**
* Tries to match the given regular expression at the current position.
* Returns the matched text if it can match, the empty string otherwise.
*/
Scanner.prototype.scan = function (re) {
var match = this.tail.match(re);
if (match && match.index === 0) {
this.tail = this.tail.substring(match[0].length);
this.pos += match[0].length;
return match[0];
}
return "";
};
/**
* Skips all text until the given regular expression can be matched. Returns
* the skipped string, which is the entire tail if no match can be made.
*/
Scanner.prototype.scanUntil = function (re) {
var match, pos = this.tail.search(re);
switch (pos) {
case -1:
match = this.tail;
this.pos += this.tail.length;
this.tail = "";
break;
case 0:
match = "";
break;
default:
match = this.tail.substring(0, pos);
this.tail = this.tail.substring(pos);
this.pos += pos;
}
return match;
};
function Context(view, parent) {
this.view = view || {};
this.parent = parent;
this._cache = {};
}
Context.make = function (view) {
return (view instanceof Context) ? view : new Context(view);
};
Context.prototype.push = function (view) {
return new Context(view, this);
};
Context.prototype.lookup = function (name) {
var value = this._cache[name];
if (!value) {
if (name == '.') {
value = this.view;
} else {
var context = this;
while (context) {
if (name.indexOf('.') > 0) {
value = context.view;
var names = name.split('.'), i = 0;
while (value && i < names.length) {
value = value[names[i++]];
}
} else {
value = context.view[name];
}
if (value != null) break;
context = context.parent;
}
}
this._cache[name] = value;
}
if (typeof value === 'function') value = value.call(this.view);
return value;
};
function Writer() {
this.clearCache();
}
Writer.prototype.clearCache = function () {
this._cache = {};
this._partialCache = {};
};
Writer.prototype.compile = function (template, tags) {
var fn = this._cache[template];
if (!fn) {
var tokens = mustache.parse(template, tags);
fn = this._cache[template] = this.compileTokens(tokens, template);
}
return fn;
};
Writer.prototype.compilePartial = function (name, template, tags) {
var fn = this.compile(template, tags);
this._partialCache[name] = fn;
return fn;
};
Writer.prototype.getPartial = function (name) {
if (!(name in this._partialCache) && this._loadPartial) {
this.compilePartial(name, this._loadPartial(name));
}
return this._partialCache[name];
};
Writer.prototype.compileTokens = function (tokens, template) {
var self = this;
return function (view, partials) {
if (partials) {
if (typeof partials === 'function') {
self._loadPartial = partials;
} else {
for (var name in partials) {
self.compilePartial(name, partials[name]);
}
}
}
return renderTokens(tokens, self, Context.make(view), template);
};
};
Writer.prototype.render = function (template, view, partials) {
return this.compile(template)(view, partials);
};
/**
* Low-level function that renders the given `tokens` using the given `writer`
* and `context`. The `template` string is only needed for templates that use
* higher-order sections to extract the portion of the original template that
* was contained in that section.
*/
function renderTokens(tokens, writer, context, template) {
var buffer = '';
var token, tokenValue, value;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
tokenValue = token[1];
switch (token[0]) {
case '#':
value = context.lookup(tokenValue);
if (typeof value === 'object') {
if (isArray(value)) {
for (var j = 0, jlen = value.length; j < jlen; ++j) {
buffer += renderTokens(token[4], writer, context.push(value[j]), template);
}
} else if (value) {
buffer += renderTokens(token[4], writer, context.push(value), template);
}
} else if (typeof value === 'function') {
var text = template == null ? null : template.slice(token[3], token[5]);
value = value.call(context.view, text, function (template) {
return writer.render(template, context);
});
if (value != null) buffer += value;
} else if (value) {
buffer += renderTokens(token[4], writer, context, template);
}
break;
case '^':
value = context.lookup(tokenValue);
// Use JavaScript's definition of falsy. Include empty arrays.
// See https://github.com/janl/mustache.js/issues/186
if (!value || (isArray(value) && value.length === 0)) {
buffer += renderTokens(token[4], writer, context, template);
}
break;
case '>':
value = writer.getPartial(tokenValue);
if (typeof value === 'function') buffer += value(context);
break;
case '&':
value = context.lookup(tokenValue);
if (value != null) buffer += value;
break;
case 'name':
value = context.lookup(tokenValue);
if (value != null) buffer += mustache.escape(value);
break;
case 'text':
buffer += tokenValue;
break;
}
}
return buffer;
}
/**
* Forms the given array of `tokens` into a nested tree structure where
* tokens that represent a section have two additional items: 1) an array of
* all tokens that appear in that section and 2) the index in the original
* template that represents the end of that section.
*/
function nestTokens(tokens) {
var tree = [];
var collector = tree;
var sections = [];
var token;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
switch (token[0]) {
case '#':
case '^':
sections.push(token);
collector.push(token);
collector = token[4] = [];
break;
case '/':
var section = sections.pop();
section[5] = token[2];
collector = sections.length > 0 ? sections[sections.length - 1][4] : tree;
break;
default:
collector.push(token);
}
}
return tree;
}
/**
* Combines the values of consecutive text tokens in the given `tokens` array
* to a single token.
*/
function squashTokens(tokens) {
var squashedTokens = [];
var token, lastToken;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
if (token) {
if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
lastToken[1] += token[1];
lastToken[3] = token[3];
} else {
lastToken = token;
squashedTokens.push(token);
}
}
}
return squashedTokens;
}
function escapeTags(tags) {
return [
new RegExp(escapeRegExp(tags[0]) + "\\s*"),
new RegExp("\\s*" + escapeRegExp(tags[1]))
];
}
/**
* Breaks up the given `template` string into a tree of token objects. If
* `tags` is given here it must be an array with two string values: the
* opening and closing tags used in the template (e.g. ["<%", "%>"]). Of
* course, the default is to use mustaches (i.e. Mustache.tags).
*/
function parseTemplate(template, tags) {
template = template || '';
tags = tags || mustache.tags;
if (typeof tags === 'string') tags = tags.split(spaceRe);
if (tags.length !== 2) throw new Error('Invalid tags: ' + tags.join(', '));
var tagRes = escapeTags(tags);
var scanner = new Scanner(template);
var sections = []; // Stack to hold section tokens
var tokens = []; // Buffer to hold the tokens
var spaces = []; // Indices of whitespace tokens on the current line
var hasTag = false; // Is there a {{tag}} on the current line?
var nonSpace = false; // Is there a non-space char on the current line?
// Strips all whitespace tokens array for the current line
// if there was a {{#tag}} on it and otherwise only space.
function stripSpace() {
if (hasTag && !nonSpace) {
while (spaces.length) {
delete tokens[spaces.pop()];
}
} else {
spaces = [];
}
hasTag = false;
nonSpace = false;
}
var start, type, value, chr, token;
while (!scanner.eos()) {
start = scanner.pos;
// Match any text between tags.
value = scanner.scanUntil(tagRes[0]);
if (value) {
for (var i = 0, len = value.length; i < len; ++i) {
chr = value.charAt(i);
if (isWhitespace(chr)) {
spaces.push(tokens.length);
} else {
nonSpace = true;
}
tokens.push(['text', chr, start, start + 1]);
start += 1;
// Check for whitespace on the current line.
if (chr == '\n') stripSpace();
}
}
// Match the opening tag.
if (!scanner.scan(tagRes[0])) break;
hasTag = true;
// Get the tag type.
type = scanner.scan(tagRe) || 'name';
scanner.scan(whiteRe);
// Get the tag value.
if (type === '=') {
value = scanner.scanUntil(eqRe);
scanner.scan(eqRe);
scanner.scanUntil(tagRes[1]);
} else if (type === '{') {
value = scanner.scanUntil(new RegExp('\\s*' + escapeRegExp('}' + tags[1])));
scanner.scan(curlyRe);
scanner.scanUntil(tagRes[1]);
type = '&';
} else {
value = scanner.scanUntil(tagRes[1]);
}
// Match the closing tag.
if (!scanner.scan(tagRes[1])) throw new Error('Unclosed tag at ' + scanner.pos);
token = [type, value, start, scanner.pos];
tokens.push(token);
if (type === '#' || type === '^') {
sections.push(token);
} else if (type === '/') {
// Check section nesting.
if (sections.length === 0) throw new Error('Unopened section "' + value + '" at ' + start);
var openSection = sections.pop();
if (openSection[1] !== value) throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
} else if (type === 'name' || type === '{' || type === '&') {
nonSpace = true;
} else if (type === '=') {
// Set the tags for the next time around.
tags = value.split(spaceRe);
if (tags.length !== 2) throw new Error('Invalid tags at ' + start + ': ' + tags.join(', '));
tagRes = escapeTags(tags);
}
}
// Make sure there are no open sections when we're done.
var openSection = sections.pop();
if (openSection) throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
tokens = squashTokens(tokens);
return nestTokens(tokens);
}
mustache.name = "mustache.js";
mustache.version = "0.7.2";
mustache.tags = ["{{", "}}"];
mustache.Scanner = Scanner;
mustache.Context = Context;
mustache.Writer = Writer;
mustache.parse = parseTemplate;
// Export the escaping function so that the user may override it.
// See https://github.com/janl/mustache.js/issues/244
mustache.escape = escapeHtml;
// All Mustache.* functions use this writer.
var defaultWriter = new Writer();
/**
* Clears all cached templates and partials in the default writer.
*/
mustache.clearCache = function () {
return defaultWriter.clearCache();
};
/**
* Compiles the given `template` to a reusable function using the default
* writer.
*/
mustache.compile = function (template, tags) {
return defaultWriter.compile(template, tags);
};
/**
* Compiles the partial with the given `name` and `template` to a reusable
* function using the default writer.
*/
mustache.compilePartial = function (name, template, tags) {
return defaultWriter.compilePartial(name, template, tags);
};
/**
* Compiles the given array of tokens (the output of a parse) to a reusable
* function using the default writer.
*/
mustache.compileTokens = function (tokens, template) {
return defaultWriter.compileTokens(tokens, template);
};
/**
* Renders the `template` with the given `view` and `partials` using the
* default writer.
*/
mustache.render = function (template, view, partials) {
return defaultWriter.render(template, view, partials);
};
// This is here for backwards compatibility with 0.4.x.
mustache.to_html = function (template, view, partials, send) {
var result = mustache.render(template, view, partials);
if (typeof send === "function") {
send(result);
} else {
return result;
}
};
}));

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