Compare commits

...

48 Commits

Author SHA1 Message Date
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
2004b8d91c Made some improvements to the compiler and extended the email helper features. 2016-06-23 16:05:37 +01:00
d82d4aeb22 Added email helper class. 2016-06-03 07:28:32 +01:00
5cd07f3b88 Removed the PDF lib since it made the installer to big for most servers. We will setup an another lib installer for the PDF library. 2016-06-02 17:34:46 +01:00
5d19f46070 Added the option to overwrite the default-fields, so you can add them to the list view in admin area and change their layout position in the edit view. Also fixed some minor bugs. 2016-06-02 17:18:49 +01:00
02f9523e1b Fixed fade-in affect problem of not loading the affect when added. 2016-05-31 06:36:31 +01:00
7f52decf16 Added fade-in option for admin views, added pdf lib to custom folder for use in projects. 2016-05-31 06:11:07 +01:00
d2aa1fce0b Improved the custom import option to include the display method override. 2016-05-20 06:00:31 +01:00
3b774a8385 This fixes #3 to insure that custom/other Data Length/Values can be set. 2016-05-12 02:26:54 +01:00
ee2fea1db8 Updated the readme file. 2016-05-10 06:47:47 +01:00
c9150e930d Changed over to V3 of footable, fixed icon display in the repeatable icon selections. 2016-05-07 02:12:30 +01:00
e21980bbea Added editing feature to custom list fields and improved the buttons to great and edit the list values. 2016-05-07 00:41:41 +01:00
32e3f6b86e Added the import method to custom import tab, and improved the import custom concept. 2016-05-05 00:14:20 +01:00
0fd9d9d169 Bug fix in the custom import option. 2016-05-04 06:51:30 +01:00
e7572e0557 Bug fix in the custom import option. 2016-05-04 06:11:32 +01:00
6b70aa45e6 Added the option to customize the import of data per view. 2016-05-04 05:53:33 +01:00
951e0c1f5d added another data type to fields called TIME. 2016-05-02 16:20:07 +01:00
57bf464111 Added another field to admin_view to add custom script to document method of component admin views. 2016-04-22 22:32:02 +01:00
6871bfd9a2 Updated some compiler methods, added footable3, fixed some known issus. 2016-04-22 13:03:43 +01:00
3bc71a935c Updated the footable Lib. 2016-03-19 03:51:35 +02:00
1cad434a39 Added the feature to insure that the PHP JText string will be updated in the Javascript useded in the footer of the views. 2016-03-11 21:27:52 +02:00
a2224e3ad9 Added list views help menu. 2016-03-11 15:21:10 +02:00
4bdb503973 Fixed a bug that limited the dynamic get from loading the correct field relations. 2016-03-10 23:52:04 +02:00
4424179425 Found that there were a view not being added to the public version, added it back in. 2016-03-10 23:34:34 +02:00
306b6b9787 fixed import error with version is ignored. 2016-03-10 23:23:23 +02:00
0c30fa7f68 Added the FTP server to components. 2016-03-04 22:58:05 +02:00
86624770b1 Added the git and ftp options. 2016-03-04 22:54:07 +02:00
21756c3e55 Fixed the bug for the image display on install, it was missing the component name. 2016-03-04 19:26:18 +02:00
ef8578104c Change the field name form type to fieldtype in the field view. 2016-03-04 02:26:29 +02:00
80670beada Change the field name form type to fieldtype in the field view. 2016-03-04 02:01:43 +02:00
3efbb7b4af Refactoring of the compiler continues. 2016-03-01 21:02:04 +02:00
36d45f2ff6 Refactoring of the compiler continues. 2016-03-01 20:44:13 +02:00
5a541340c8 Updated the readme. 2016-02-29 13:05:37 +02:00
15e3c82dd2 Trying to remove random variable changes per/build, or at least to cut it down in a major way. 2016-02-26 15:57:30 +02:00
2ecf186846 Fixed a method from public to protected status error. All other changes are only random variable name and date changes (due to automation) 2016-02-26 14:46:15 +02:00
fa199947d2 Refactoring the compiler class has started. All other changes are only random variable name and date changes (due to automation) 2016-02-26 02:20:09 +02:00
dea8ca3cae All other changes are only random variable name and date changes (due to automation) 2016-02-20 22:20:23 +02:00
36d3a10ef8 Fixed the created_by auto save to current user if none is set at the creation of any new item. All other changes are only random variable name and date changes (due to automation) 2016-02-20 20:13:00 +02:00
984 changed files with 52377 additions and 28309 deletions

View File

@ -1,36 +1,30 @@
# Component Builder (2.1.0) # Component Builder (2.1.20)
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 that is highly advanced, truly able to build extremely complex components in a fraction of the time.
> **You can purchase Component Builder with the following components as demo setup inside Component Builder:** > **You can purchase demo content inside Component Builder:**
+ **Basic Version** ([get this demo set](https://www.vdm.io/joomla-component-builder)) + **Development Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
*Help View Integration* *Help View Integration*
+ **Medium Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
*Demo Component* see the build on [github] (https://github.com/namibia/demo-joomla-3-component) *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) + **Dev + Howtos Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
+ **Advanced Version** ([get this demo set](https://www.vdm.io/joomla-component-builder))
*All the above* *All the above*
*Component Builder* see the build on [github] (https://github.com/vdm-io/Joomla-Component-Builder) *Sermon Distributor* see the build on [github] (https://github.com/SermonDistributor/Joomla-3-Component)
## Training & Help Videos *Training & Help Videos* tutorials in the component included.
The Medium and Advanced Versions come with video tutorials in the component included. # gitHub Support
# Extra Support Would you require more help please open and issue here on [gitHub today](https://github.com/vdm-io/Joomla-Component-Builder/issues)!
Would you require more help VDM.io has a number of support plans available [visit us today!](https://www.vdm.io/joomla-component-builder).
# Build Details # Build Details
@ -38,38 +32,19 @@ Would you require more help VDM.io has a number of support plans available [visi
+ *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io) + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io)
+ *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder) + *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 18th February, 2016 + *Last Build*: 7th September, 2016
+ *Version*: 2.1.0 + *Version*: 2.1.20
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **84031**
## Build Time + *File count*: **513**
+ *Folder count*: **98**
**223 Hours** or **28 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **79960**
+ *File count*: **491**
+ *Folder count*: **96**
**147 Hours** or **18 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @56hours** = codingtime / 4;
> **planning @32hours** = codingtime / 7;
> **mapping @22hours** = codingtime / 10;
> **office @37hours** = codingtime / 6;)
**370 Hours** or **46 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **9.2 weeks** or **1.9 months**
> This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder). > 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) > 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,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin.css @subpackage admin.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_view.css @subpackage admin_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_views.css @subpackage admin_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage component.css @subpackage component.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage components.css @subpackage components.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_view.css @subpackage custom_admin_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_views.css @subpackage custom_admin_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.css @subpackage dynamic_get.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.css @subpackage dynamic_gets.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage field.css @subpackage field.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fields.css @subpackage fields.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtype.css @subpackage fieldtype.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtypes.css @subpackage fieldtypes.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_document.css @subpackage help_document.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layout.css @subpackage layout.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layouts.css @subpackage layouts.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_view.css @subpackage site_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_views.css @subpackage site_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippet.css @subpackage snippet.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippets.css @subpackage snippets.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage template.css @subpackage template.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage templates.css @subpackage templates.css

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

View File

@ -1,17 +0,0 @@
/*----------------------------------------------------------------------------------| www.giz.de |----/
###COMPANYNAME###
/-------------------------------------------------------------------------------------------------------/
@version ###VERSION###
@build ###BUILDDATE###
@created ###CREATIONDATE###
@package ###Component_name###
@subpackage ###FILENAME###
@author ###AUTHOR### <###AUTHORWEBSITE###>
@owner ###COMPANYNAME###
@copyright ###COPYRIGHT###
@license ###LICENSE###
/-------------------------------------------------------------------------------------------------------/
###SHORT_DESCRIPTION###
/------------------------------------------------------------------------------------------------------*/

View File

@ -29,4 +29,6 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tooltip');
?>###DASH_DISPLAY_DATA### ?>###DASH_DISPLAY_DATA###

View File

@ -7,7 +7,7 @@
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| | | |
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder @package Component Builder
@ -16,9 +16,9 @@
@my wife Roline van der Merwe <http://www.vdm.io/> @my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved @copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/ /-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file // No direct access to this file
@ -102,9 +102,15 @@ abstract class ###Component###Helper
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// Create a new query object. // Create a new query object.
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select($db->quoteName(array($what))); $query->select($db->quoteName(array($what)));
$query->from($db->quoteName('#__'.$main.'_'.$table)); if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where)) if (is_numeric($where))
{ {
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where); $query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
@ -162,31 +168,33 @@ abstract class ###Component###Helper
return false; return false;
} }
public static function jsonToString($value, $sperator = ", ") public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) { if (json_last_error() === JSON_ERROR_NONE)
// is JSON {
// is JSON
if (self::checkArray($result)) if (self::checkArray($result))
{ {
$value = ''; if (self::checkString($table))
$counter = 0;
foreach ($result as $string)
{ {
if ($counter) $names = array();
foreach ($result as $val)
{ {
$value .= $sperator.$string; if ($name = self::getVar($table, $val, 'id', 'name'))
{
$names[] = $name;
}
} }
else if (self::checkArray($names))
{ {
$value .= $string; return (string) implode($sperator,$names);
} }
$counter++;
} }
return $value; return (string) implode($sperator,$result);
} }
return json_decode($value); return (string) json_decode($value);
} }
return $value; return $value;
} }
@ -201,7 +209,7 @@ abstract class ###Component###Helper
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select(array('a.published')); $query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a'); $query->from('#__###component###_'.$type.' AS a');
$query->where('a.id = '.$id); $query->where('a.id = '. (int) $id);
$query->where('a.published = 1'); $query->where('a.published = 1');
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
@ -219,7 +227,7 @@ abstract class ###Component###Helper
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select(array('a.title')); $query->select(array('a.title'));
$query->from('#__usergroups AS a'); $query->from('#__usergroups AS a');
$query->where('a.id = '.$id); $query->where('a.id = '. (int) $id);
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
@ -478,7 +486,7 @@ abstract class ###Component###Helper
if (!$asset->check() || !$asset->store()) if (!$asset->check() || !$asset->store())
{ {
JError::raiseWarning(500, $asset->getError()); JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false; return false;
} }
else else
@ -572,6 +580,16 @@ abstract class ###Component###Helper
return $button->input; return $button->input;
} }
public static function checkJson($string)
{
if (self::checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
public static function checkObject($object) public static function checkObject($object)
{ {
@ -831,7 +849,7 @@ abstract class ###Component###Helper
$w .= ' '; $w .= ' ';
if($r < 100) if($r < 100)
{ {
$word .= 'and '; $w .= 'and ';
} }
$w .= self::numberToString($r); $w .= self::numberToString($r);
} }

View File

@ -0,0 +1,279 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
/**
* ###Component### component email helper
*/
abstract class ###Component###Email
{
/**
* Configuraiton object
*
* @var JConfig
*/
public static $config = null;
/**
* Mailer object
*
* @var JMail
*/
public static $mailer = null;
/**
* Get a configuration object
*
*/
public static function getConfig()
{
if (!self::$config)
{
self::$config = JComponentHelper::getParams('com_###component###');
}
return self::$config;
}
/**
* Get a mailer object.
*
* Returns the global {@link JMail} object, only creating it if it doesn't already exist.
*
* @return JMail object
*
* @see JMail
*/
public static function getMailer()
{
if (!self::$mailer)
{
self::$mailer = self::createMailer();
}
$copy = clone self::$mailer;
return $copy;
}
/**
* Create a mailer object
*
* @return JMail object
*
* @see JMail
*/
protected static function createMailer()
{
// set component params
$conf = self::getConfig();
// now load the mailer
$mailer = $conf->get('mailer', 'global');
// Create a JMail object
$mail = JMail::getInstance();
// check if set to global
if ('global' == $mailer)
{
// get the global details
$globalConf = JFactory::getConfig();
$mailer = $globalConf->get('mailer');
$smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
$smtpuser = $globalConf->get('smtpuser');
$smtppass = $globalConf->get('smtppass');
$smtphost = $globalConf->get('smtphost');
$smtpsecure = $globalConf->get('smtpsecure');
$smtpport = $globalConf->get('smtpport');
$sendmail = $globalConf->get('sendmail');
$mailfrom = $globalConf->get('mailfrom');
$fromname = $globalConf->get('fromname');
}
else
{
$smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
$smtpuser = $conf->get('smtpuser');
$smtppass = $conf->get('smtppass');
$smtphost = $conf->get('smtphost');
$smtpsecure = $conf->get('smtpsecure');
$smtpport = $conf->get('smtpport');
$sendmail = $conf->get('sendmail');
$mailfrom = $conf->get('mailfrom');
$fromname = $conf->get('fromname');
$mailreply = $conf->get('mailreply');
$replyname = $conf->get('replyname');
// set the global reply-to
if ($mailreply && $fromname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $mailreply, $replyname ) );
}
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// Default mailer is to use PHP's mail function
switch ($mailer)
{
case 'smtp':
// set the SMTP option
$mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
break;
case 'sendmail':
// set the sendmail option
$mail->useSendmail($sendmail);
$mail->IsSendmail();
break;
default:
$mail->IsMail();
break;
}
return $mail;
}
/**
* Send an email
*
* @return bool on success
*
*/
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
{
// Get a JMail instance
$mail = self::getMailer();
// set component params
$conf = self::getConfig();
// do some house cleaning
$mail->ClearReplyTos();
// set if we have override
if ($mailfrom && $fromname)
{
$mail->setSender(array($mailfrom, $fromname));
}
// load the bounce email as sender if set
if (!is_null($bounce_email))
{
$mail->Sender = $bounce_email;
}
// Add tag to email to identify it
if (!is_null($idsession))
{
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
}
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
// Are we sending the email as HTML?
if ($mode)
{
$mail->IsHTML(true);
$mail->AltBody = $textonly;
}
//embed images
if ($embeded)
{
if(###Component###Helper::checkArray($embeds))
{
foreach($embeds as $embed)
{
$mail->AddEmbeddedImage($embed->Path,$embed->FileName);
}
}
}
$mail->addRecipient($recipient);
$mail->addCC($cc);
$mail->addBCC($bcc);
$mail->addAttachment($attachment);
// Take care of reply email addresses
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);
}
}
elseif (!empty($mailreply))
{
$mail->ClearReplyTos();
$mail->addReplyTo($mailreply, $replyname);
}
// check if we can add the DKIM to email
if ($conf->get('enable_dkim'))
{
if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
$mail->DKIM_domain = $conf->get('dkim_domain');
$mail->DKIM_selector = $conf->get('dkim_selector');
$mail->DKIM_identity = $conf->get('dkim_identity');
$mail->DKIM_passphrase = $conf->get('dkim_passphrase');
$tmp = tempnam(sys_get_temp_dir(), 'VDM');
$h = fopen($tmp, 'w');
fwrite($h, $conf->get('dkim_private'));
fclose($h);
$mail->DKIM_private = $tmp;
}
}
$sendmail = $mail->Send();
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
@unlink($tmp);
}
if (method_exists('###Component###Helper','storeMessage'))
{
// store the massage if the method is set
###Component###Helper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email');
}
return $sendmail;
}
}

View File

@ -17,7 +17,7 @@
@copyright Copyright (C) 2015. All Rights Reserved @copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/ /-----------------------------------------------------------------------------------------------------------------------------*/
@ -34,34 +34,37 @@ defined('_JEXEC') or die('Restricted access');
*/ */
abstract class ###Component###Helper abstract class ###Component###Helper
{###SITE_GLOBAL_EVENT_HELPER### ###SITE_CUSTOM_HELPER_SCRIPT### {###SITE_GLOBAL_EVENT_HELPER### ###SITE_CUSTOM_HELPER_SCRIPT###
public static function jsonToString($value) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) { if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
{
if (self::checkString($table))
{ {
$value = ''; $names = array();
$counter = 0; foreach ($result as $val)
foreach ($result as $string)
{ {
if ($counter) if ($name = self::getVar($table, $val, 'id', 'name'))
{ {
$value .= ", ".$string; $names[] = $name;
} }
else
{
$value .= $string;
}
$counter++;
} }
if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
} }
return json_decode($value); return (string) implode($sperator,$result);
} }
return $value; return (string) json_decode($value);
} }
return $value;
}
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
@ -168,7 +171,7 @@ abstract class ###Component###Helper
if (!$asset->check() || !$asset->store()) if (!$asset->check() || !$asset->store())
{ {
JError::raiseWarning(500, $asset->getError()); JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false; return false;
} }
else else
@ -273,9 +276,15 @@ abstract class ###Component###Helper
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// Create a new query object. // Create a new query object.
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
$query->select($db->quoteName(array($what))); if (empty($table))
$query->from($db->quoteName('#__'.$main.'_'.$table)); {
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where)) if (is_numeric($where))
{ {
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where); $query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
@ -332,6 +341,45 @@ abstract class ###Component###Helper
} }
return false; return false;
} }
public static function isPublished($id,$type)
{
if ($type == 'raw')
{
$type = 'item';
}
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a');
$query->where('a.id = '. (int) $id);
$query->where('a.published = 1');
$db->setQuery($query);
$db->execute();
$found = $db->getNumRows();
if($found)
{
return true;
}
return false;
}
public static function getGroupName($id)
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select(array('a.title'));
$query->from('#__usergroups AS a');
$query->where('a.id = '. (int) $id);
$db->setQuery($query);
$db->execute();
$found = $db->getNumRows();
if($found)
{
return $db->loadResult();
}
return $id;
}
/** /**
* Get the actions permissions * Get the actions permissions
@ -524,6 +572,16 @@ abstract class ###Component###Helper
} }
return $result; return $result;
} }
public static function checkJson($string)
{
if (self::checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
public static function checkObject($object) public static function checkObject($object)
{ {
@ -783,7 +841,7 @@ abstract class ###Component###Helper
$w .= ' '; $w .= ' ';
if($r < 100) if($r < 100)
{ {
$word .= 'and '; $w .= 'and ';
} }
$w .= self::numberToString($r); $w .= self::numberToString($r);
} }

View File

@ -63,9 +63,9 @@ class ###Component###ControllerAjax extends JControllerLegacy
} }
else 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 else
{ {

View File

@ -63,9 +63,9 @@ class ###Component###ControllerAjax extends JControllerLegacy
} }
else 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 else
{ {

View File

@ -117,10 +117,10 @@ class ###Component###ControllerHelp extends JControllerLegacy
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">'; $text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">'; $text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
// build the help text // build the help text
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>"; $text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
$text[] = str_replace(array_keys($images),array_values($images),$document->content); $text[] = str_replace(array_keys($images),array_values($images),$document->content);
// end template // end template
$text[] = '</div>'; $text[] = '</div><br /><br />';
$text[] = '</div>'; $text[] = '</div>';
$text[] = "</body>"; $text[] = "</body>";
$text[] = "</html>"; $text[] = "</html>";

View File

@ -118,10 +118,10 @@ class ###Component###ControllerHelp extends JControllerLegacy
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">'; $text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">'; $text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
// build the help text // build the help text
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>"; $text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
$text[] = str_replace(array_keys($images),array_values($images),$document->content); $text[] = str_replace(array_keys($images),array_values($images),$document->content);
// end template // end template
$text[] = '</div>'; $text[] = '</div><br /><br />';
$text[] = '</div>'; $text[] = '</div>';
$text[] = "</body>"; $text[] = "</body>";
$text[] = "</html>"; $text[] = "</html>";

View File

@ -0,0 +1,70 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Controller
*/
class ###Component###Controller###View### extends JControllerLegacy
{
/**
* Import an spreadsheet.
*
* @return void
*/
public function import()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('###View###');
if ($model->import())
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_###component###.redirect_url');
if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
}
else
{
// wipe out the user state when we're going to redirect
$app->setUserState('com_###component###.redirect_url', '');
$app->setUserState('com_###component###.message', '');
$app->setUserState('com_###component###.extension_message', '');
}
$this->setRedirect($redirect_url);
}
}

View File

@ -199,7 +199,7 @@ class ###Component###Model###View### extends JModelAdmin
{ {
$table->created = $date->toSql(); $table->created = $date->toSql();
// set the user // set the user
if ($table->created_by == 0) if ($table->created_by == 0 || empty($table->created_by))
{ {
$table->created_by = $user->id; $table->created_by = $user->id;
} }
@ -267,6 +267,26 @@ class ###Component###Model###View### extends JModelAdmin
return true; 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. * Method to perform batch operations on an item or a set of items.

View File

@ -199,7 +199,7 @@ class ###Component###Model###View### extends JModelAdmin
{ {
$table->created = $date->toSql(); $table->created = $date->toSql();
// set the user // set the user
if ($table->created_by == 0) if ($table->created_by == 0 || empty($table->created_by))
{ {
$table->created_by = $user->id; $table->created_by = $user->id;
} }

View File

@ -97,9 +97,10 @@ class ###Component###Model###SView### extends JModelItem
// check if this user has permission to access item // check if this user has permission to access item
if (!$this->user->authorise('###sview###.access', 'com_###component###')) if (!$this->user->authorise('###sview###.access', 'com_###component###'))
{ {
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) // 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; return false;
} }
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
@ -126,7 +127,7 @@ class ###Component###Model###SView### extends JModelItem
if ($e->getCode() == 404) if ($e->getCode() == 404)
{ {
// Need to go thru the error handler to allow Redirect to work. // Need to go thru the error handler to allow Redirect to work.
JError::raiseError(404, $e->getMessage()); JError::raiseWaring(404, $e->getMessage());
} }
else else
{ {

View File

@ -99,9 +99,10 @@ class ###Component###Model###SView### extends JModelItem
// check if this user has permission to access item // check if this user has permission to access item
if (!$this->user->authorise('site.###sview###.access', 'com_###component###')) 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) // 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; return false;
} }
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
@ -128,7 +129,7 @@ class ###Component###Model###SView### extends JModelItem
if ($e->getCode() == 404) if ($e->getCode() == 404)
{ {
// Need to go thru the error handler to allow Redirect to work. // Need to go thru the error handler to allow Redirect to work.
JError::raiseError(404, $e->getMessage()); JError::raiseWaring(404, $e->getMessage());
} }
else else
{ {

View File

@ -55,7 +55,7 @@ class ###Component###ModelImport extends JModelLegacy
* Import Settings * Import Settings
*/ */
protected $getType = NULL; protected $getType = NULL;
protected $dataType = NULL; protected $dataType = NULL;
/** /**
* Method to auto-populate the model state. * Method to auto-populate the model state.
@ -201,7 +201,8 @@ class ###Component###ModelImport extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // 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. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -209,21 +210,21 @@ class ###Component###ModelImport extends JModelLegacy
// Make sure that file uploads are enabled in php // Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads')) 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; return false;
} }
// If there is no uploaded file, we have a problem... // If there is no uploaded file, we have a problem...
if (!is_array($userfile)) 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; return false;
} }
// Check if there was a problem uploading the file. // Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1) 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; return false;
} }
@ -261,7 +262,8 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$input = JFactory::getApplication()->input; $app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -269,7 +271,7 @@ class ###Component###ModelImport extends JModelLegacy
// Did you give us a valid path? // Did you give us a valid path?
if (!file_exists($p_dir)) 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; return false;
} }
@ -279,7 +281,7 @@ class ###Component###ModelImport extends JModelLegacy
// Did you give us a valid package? // Did you give us a valid package?
if (!$type) 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 // check the extention
@ -290,7 +292,7 @@ class ###Component###ModelImport extends JModelLegacy
break; break;
default: 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; return false;
break; break;
} }
@ -310,15 +312,16 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$input = JFactory::getApplication()->input; $app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
// Did you give us a URL? // Did you give us a URL?
if (!$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; return false;
} }
@ -328,7 +331,7 @@ class ###Component###ModelImport extends JModelLegacy
// Was the package downloaded? // Was the package downloaded?
if (!$p_file) if (!$p_file)
{ {
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL')); $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false; return false;
} }
@ -349,6 +352,7 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -362,7 +366,7 @@ class ###Component###ModelImport extends JModelLegacy
default: default:
// Cleanup the import files // Cleanup the import files
$this->remove($archivename); $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; return false;
break; break;
} }
@ -511,7 +515,6 @@ class ###Component###ModelImport extends JModelLegacy
// reset all buckets // reset all buckets
$query = $db->getQuery(true); $query = $db->getQuery(true);
$fields = array(); $fields = array();
$version = false;
// Fields to update. // Fields to update.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -534,7 +537,6 @@ class ###Component###ModelImport extends JModelLegacy
if ('version' == $target[$key]) if ('version' == $target[$key])
{ {
$cell = (int) $version + 1; $cell = (int) $version + 1;
$version = true;
} }
// verify publish authority // verify publish authority
if ('published' == $target[$key] && !$canState) if ('published' == $target[$key] && !$canState)
@ -559,10 +561,6 @@ class ###Component###ModelImport extends JModelLegacy
// load the defaults // load the defaults
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id); $fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate); $fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
if (!$version)
{
$fields[] = $db->quoteName('version') . " = " . (int) $version + 1;
}
// Conditions for which records should be updated. // Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('id') . ' = ' . $id $db->quoteName('id') . ' = ' . $id

View File

@ -0,0 +1,370 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Model
*/
class ###Component###Model###View### extends JModelLegacy
{
/**
* @var object JTable object
*/
protected $_table = null;
/**
* @var object JTable object
*/
protected $_url = null;
/**
* Model context string.
*
* @var string
*/
protected $_context = 'com_###component###.###view###';
/**
* Import Settings
*/
protected $getType = NULL;
protected $dataType = NULL;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
*/
protected function populateState()
{
$app = JFactory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_###component###.message'));
$app->setUserState('com_###component###.message', '');
// Recall the 'Import from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
$this->setState('import.directory', $path);
// set uploading values
$this->use_streams = false;
$this->allow_unsafe = false;
$this->safeFileOptions = array();
parent::populateState();
}
###IMPORT_METHOD_CUSTOM###
/**
* Works out an importation spreadsheet from a HTTP upload
*
* @return spreadsheet definition or false on failure
*/
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$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');
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
$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))
{
$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)
{
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
// Build the appropriate paths
$config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
{
$session = JFactory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
// was not uploaded
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($userfile['name']);
return $package;
}
/**
* Import an spreadsheet from a directory
*
* @return array Spreadsheet details or false on failure
*
*/
protected function _getPackageFromFolder()
{
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
$p_dir = JPath::clean($p_dir);
// Did you give us a valid path?
if (!file_exists($p_dir))
{
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
// Detect the package type
$type = $this->getType;
// Did you give us a valid package?
if (!$type)
{
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
switch(strtolower(pathinfo($p_dir, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
return $package;
}
/**
* Import an spreadsheet from a URL
*
* @return Package details or false on failure
*
*/
protected function _getPackageFromUrl()
{
$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)
{
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
// Download the package at the URL given
$p_file = JInstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file)
{
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($p_file);
return $package;
}
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
*
* @param string $p_filename The uploaded package filename or import directory
*
* @return array of elements
*
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
// check the extention
switch(strtolower(pathinfo($archivename, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
// Cleanup the import files
$this->remove($archivename);
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
$config = JFactory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
// set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type
$check['type'] = $this->getType;
return $check;
}
/**
* Clean up temporary uploaded spreadsheet
*
* @param string $package Name of the uploaded spreadsheet file
*
* @return boolean True on success
*
*/
protected function remove($package)
{
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
}
}
###IMPORT_SETDATE_METHOD_CUSTOM###
###IMPORT_SAVE_METHOD_CUSTOM###
protected function getAlias($name,$type = false)
{
// sanitize the name to an alias
if (JFactory::getConfig()->get('unicodeslugs') == 1)
{
$alias = JFilterOutput::stringURLUnicodeSlug($name);
}
else
{
$alias = JFilterOutput::stringURLSafe($name);
}
// must be a uniqe alias
if ($type)
{
return $this->getUniqe($alias,'alias',$type);
}
return $alias;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
* @param string $type table.
*
* @return string New value.
*/
protected function getUniqe($value,$field,$type)
{
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
$value = JString::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;
}
protected function getAliasesUsed($table)
{
// Get a db connection.
$db = JFactory::getDbo();
// first we check if there is a alias column
$columns = $db->getTableColumns('#__###component###_'.$table);
if(isset($columns['alias'])){
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('alias')));
$query->from($db->quoteName('#__###component###_'.$table));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$aliases = $db->loadColumn();
foreach($aliases as $alias)
{
$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
}
}
return true;
}
return false;
}
}

View File

@ -95,7 +95,7 @@ class ###Component###Model###Views### extends JModelList
public function getItems() public function getItems()
{###LICENSE_LOCKED_CHECK### ###CHECKINCALL### {###LICENSE_LOCKED_CHECK### ###CHECKINCALL###
// load parent items // 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
return $items; return $items;

View File

@ -67,7 +67,7 @@ class ###Component###Model###SViews### extends JModelList
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true;###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### ###CUSTOM_ADMIN_GET_LIST_QUERY### $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
} }
/** /**
@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList
// check if this user has permission to access items // check if this user has permission to access items
if (!$user->authorise('###sviews###.access', 'com_###component###')) if (!$user->authorise('###sviews###.access', 'com_###component###'))
{ {
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) // 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; return false;
}###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### }###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS###
// load parent items // load parent items

View File

@ -67,7 +67,7 @@ class ###Component###Model###SViews### extends JModelList
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true;###SITE_CUSTOM_BEFORE_LIST_QUERY### ###SITE_GET_LIST_QUERY### $this->initSet = true; ###SITE_GET_LIST_QUERY###
} }
/** /**
@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList
// check if this user has permission to access items // check if this user has permission to access items
if (!$user->authorise('site.###sview###.access', 'com_###component###')) 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) // 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; return false;
}###LICENSE_LOCKED_CHECK### ###SITE_BEFORE_GET_ITEMS### }###LICENSE_LOCKED_CHECK### ###SITE_BEFORE_GET_ITEMS###
// load parent items // load parent items

View File

@ -67,7 +67,7 @@ class ###Component###View###SView### extends JViewLegacy
// hide the main menu // hide the main menu
$this->app->input->set('hidemainmenu', true); $this->app->input->set('hidemainmenu', true);
// set the title // set the title
if ($this->item->name) if (isset($this->item->name) && $this->item->name)
{ {
$title = $this->item->name; $title = $this->item->name;
} }

View File

@ -122,7 +122,7 @@ class ###Component###View###View### extends JViewLegacy
$document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); $document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS### $document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
$document->addScript(JURI::root() . $this->script); $document->addScript(JURI::root() . $this->script);
$document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js"); $document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');
} }
} }

View File

@ -131,7 +131,7 @@ class ###Component###View###View### extends JViewLegacy
$document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS### $document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
// default javascript of this view // default javascript of this view
$document->addScript(JURI::root().$this->script); $document->addScript(JURI::root().$this->script);
$document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js"); $document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');
} }
} }

View File

@ -0,0 +1,61 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### ###View### View
*/
class ###Component###View###View### extends JViewLegacy
{###IMPORT_DISPLAY_METHOD_CUSTOM###
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###');
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_###component###');
}
// set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###view###');
if (###Component###Helper::checkString($help_url))
{
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
}
}
}

View File

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

View File

@ -32,7 +32,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check. // Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_###component###')) 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 // Load cms libraries
@ -46,7 +46,7 @@ $document->addStyleSheet('components/com_###component###/assets/css/admin.css');
$document->addScript('components/com_###component###/assets/js/admin.js'); $document->addScript('components/com_###component###/assets/js/admin.js');
// require helper files // require helper files
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT### ###ADMIN_GLOBAL_EVENT### JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT### ###ADMIN_GLOBAL_EVENT###
// import joomla controller library // import joomla controller library

View File

@ -35,7 +35,7 @@ $document->addStyleSheet('components/com_###component###/assets/css/site.css');
$document->addScript('components/com_###component###/assets/js/site.js'); $document->addScript('components/com_###component###/assets/js/site.js');
// Require helper files // Require helper files
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
JLoader::register('###Component###HelperRoute', dirname(__FILE__) . '/helpers/route.php');###LICENSE_LOCKED_INT### ###SITE_GLOBAL_EVENT### JLoader::register('###Component###HelperRoute', dirname(__FILE__) . '/helpers/route.php');###LICENSE_LOCKED_INT### ###SITE_GLOBAL_EVENT###
// import joomla controller library // import joomla controller library

View File

@ -35,20 +35,9 @@ JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select'); JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
?> ?>
<?php if ($this->canDo->get('###sview###.access')): ?> <?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
<script type="text/javascript"> <?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
Joomla.submitbutton = function(task) { <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">
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">
<input type="hidden" name="task" value="" /> <input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?> <?php echo JHtml::_('form.token'); ?>
</form>###CUSTOM_ADMIN_BODY### </form>###CUSTOM_ADMIN_BODY###

View File

@ -32,10 +32,10 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
JHtml::_('jquery.framework'); JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip'); JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true); JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList)) : ?>
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList)) : ?>
Joomla.continueImport = function() Joomla.continueImport = function()
{ {
var form = document.getElementById('adminForm'); var form = document.getElementById('adminForm');
@ -62,7 +62,7 @@ JHtml::_('script', 'system/core.js', false, true);
form.submit(); form.submit();
} }
}; };
<?php else: ?> <?php else: ?>
Joomla.submitbutton = function() Joomla.submitbutton = function()
{ {
var form = document.getElementById('adminForm'); var form = document.getElementById('adminForm');
@ -115,25 +115,25 @@ JHtml::_('script', 'system/core.js', false, true);
form.submit(); form.submit();
} }
}; };
<?php endif; ?> <?php endif; ?>
// Add spindle-wheel for importations: // Add spindle-wheel for importations:
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
var outerDiv = $('body'); var outerDiv = $('body');
$('<div id="loading"></div>') $('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_###component###/assets/images/import.gif') 50% 15% no-repeat") .css("background", "rgba(255, 255, 255, .8) url('components/com_###component###/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - $(window).scrollTop()) .css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", outerDiv.position().left - $(window).scrollLeft()) .css("left", outerDiv.position().left - $(window).scrollLeft())
.css("width", outerDiv.width()) .css("width", outerDiv.width())
.css("height", outerDiv.height()) .css("height", outerDiv.height())
.css("position", "fixed") .css("position", "fixed")
.css("opacity", "0.80") .css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)") .css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)") .css("filter", "alpha(opacity = 80)")
.css("display", "none") .css("display", "none")
.appendTo(outerDiv); .appendTo(outerDiv);
}); });
</script> </script>
@ -148,89 +148,87 @@ JHtml::_('script', 'system/core.js', false, true);
<?php else : ?> <?php else : ?>
<div id="j-main-container"> <div id="j-main-container">
<?php endif;?> <?php endif;?>
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList) && ###Component###Helper::checkArray($this->headers)) : ?> <?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList) && ###Component###Helper::checkArray($this->headers)) : ?>
<fieldset class="uploadform"> <fieldset class="uploadform">
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend> <legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
<div class="control-group"> <div class="control-group">
<label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_TABLE_COLUMNS'); ?></h4></label> <label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_TABLE_COLUMNS'); ?></h4></label>
<div class="controls"> <div class="controls">
<label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_FILE_COLUMNS'); ?></h4></label> <label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_FILE_COLUMNS'); ?></h4></label>
</div> </div>
</div> </div>
<?php foreach($this->headerList as $name => $title): ?> <?php foreach($this->headerList as $name => $title): ?>
<div class="control-group"> <div class="control-group">
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label> <label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
<div class="controls"> <div class="controls">
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" > <select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
<option value=""><?php echo JText::_('COM_###COMPONENT###_IMPORT_PLEASE_SELECT_COLUMN'); ?></option> <option value=""><?php echo JText::_('COM_###COMPONENT###_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
<option value="IGNORE"><?php echo JText::_('COM_###COMPONENT###_IMPORT_IGNORE_COLUMN'); ?></option> <option value="IGNORE"><?php echo JText::_('COM_###COMPONENT###_IMPORT_IGNORE_COLUMN'); ?></option>
<?php foreach($this->headers as $value => $option): ?> <?php foreach($this->headers as $value => $option): ?>
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?> <?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
<option value="<?php echo ###Component###Helper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo ###Component###Helper::htmlEscape($option); ?></option> <option value="<?php echo ###Component###Helper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo ###Component###Helper::htmlEscape($option); ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<div class="form-actions"> <div class="form-actions">
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" /> <input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
</div> </div>
</fieldset> </fieldset>
<input type="hidden" name="gettype" value="continue" /> <input type="hidden" name="gettype" value="continue" />
<?php else: ?> <?php else: ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?> <?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_###COMPONENT###_IMPORT_FROM_UPLOAD', true)); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_###COMPONENT###_IMPORT_FROM_UPLOAD', true)); ?>
<fieldset class="uploadform"> <fieldset class="uploadform">
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend> <legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group"> <div class="control-group">
<label for="import_package" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE'); ?></label> <label for="import_package" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE'); ?></label>
<div class="controls"> <div class="controls">
<input class="input_box" id="import_package" name="import_package" type="file" size="57" /> <input class="input_box" id="import_package" name="import_package" type="file" size="57" />
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small> <input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div> </div>
</fieldset> </fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_###COMPONENT###_IMPORT_FROM_DIRECTORY', true)); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_###COMPONENT###_IMPORT_FROM_DIRECTORY', true)); ?>
<fieldset class="uploadform"> <fieldset class="uploadform">
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend> <legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group"> <div class="control-group">
<label for="import_directory" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_DIRECTORY'); ?></label> <label for="import_directory" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
<div class="controls"> <div class="controls">
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" /> <input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small> <input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div> </div>
</fieldset> </fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_###COMPONENT###_IMPORT_FROM_URL', true)); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_###COMPONENT###_IMPORT_FROM_URL', true)); ?>
<fieldset class="uploadform"> <fieldset class="uploadform">
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend> <legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group"> <div class="control-group">
<label for="import_url" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_URL'); ?></label> <label for="import_url" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_URL'); ?></label>
<div class="controls"> <div class="controls">
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" /> <input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small> <input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div> </div>
</fieldset> </fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="gettype" value="upload" /> <input type="hidden" name="gettype" value="upload" />
<?php endif; ?> <?php endif; ?>
<input type="hidden" name="task" value="import.import" /> <input type="hidden" name="task" value="import.import" />
<?php echo JHtml::_('form.token'); ?> <?php echo JHtml::_('form.token'); ?>
</form> </form>
</div> </div>

View File

@ -0,0 +1,36 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###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::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
?> ?>
<?php if ($this->canDo->get('###sview###.access')): ?> <?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
<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_###component###&view=###sviews###'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"> <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### <input type="hidden" name="task" value="" />###HIDDEN_INPUT_VALUES###
<?php echo JHtml::_('form.token'); ?> <?php echo JHtml::_('form.token'); ?>

View File

@ -30,16 +30,18 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
?> ?>
<?php if(is_array($this->icons['main'])) :?> <?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
<?php foreach($this->icons['main'] as $icon): ?> <?php foreach($this->icons['main'] as $icon): ?>
<div class="dashboard-wraper"> <div class="dashboard-wraper">
<div class="dashboard-content"> <div class="dashboard-content">
<a class="icon hasTip" href="<?php echo $icon->url; ?>"> <a class="icon" href="<?php echo $icon->url; ?>">
<img alt="<?php echo $icon->alt; ?>" src="components/com_###component###/assets/images/icons/<?php echo $icon->image; ?>"> <img alt="<?php echo $icon->alt; ?>" src="components/com_###component###/assets/images/icons/<?php echo $icon->image; ?>">
<span class="dashboard-title"><?php echo JText::_($icon->name); ?></span> <span class="dashboard-title"><?php echo JText::_($icon->name); ?></span>
</a> </a>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<div class="clearfix"></div> <div class="clearfix"></div>
<?php else: ?>
<div class="alert alert-error"><h4 class="alert-heading"><?php echo JText::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo JText::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
<?php endif; ?> <?php endif; ?>

View File

@ -36,7 +36,8 @@ JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_###component###'); $componentParams = JComponentHelper::getParams('com_###component###');
?> ?>
###EDITBODYFADEIN###
<form action="<?php echo JRoute::_('index.php?option=com_###component###&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"> <form action="<?php echo JRoute::_('index.php?option=com_###component###&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
###EDITBODY### ###EDITBODY###
</form>###EDITBODYSCRIPT### </form>
</div>###EDITBODYSCRIPT###

View File

@ -1 +1,6 @@
###INSTALL### ###INSTALL###
--
-- Always insure this column is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';

View File

@ -225,6 +225,11 @@
"rename": false, "rename": false,
"type": "encrypt" "type": "encrypt"
}, },
"Helper_email.php": {
"path": "c0mp0n3nt/admin/helpers",
"rename": "Helper_",
"type": "emailer"
},
"DASHJControllerAdmin.php": { "DASHJControllerAdmin.php": {
"path": "c0mp0n3nt/admin/controllers", "path": "c0mp0n3nt/admin/controllers",
"rename": "DASHJControllerAdmin", "rename": "DASHJControllerAdmin",
@ -460,6 +465,28 @@
"rename": false, "rename": false,
"type": "import" "type": "import"
}, },
"JControllerLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/controllers",
"rename": "JControllerLegacy_import_custom",
"type": "customimport"
},
"JModelLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/models",
"rename": "JModelLegacy_import_custom",
"type": "customimport"
},
"JViewLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/views/VIEW",
"rename": "new",
"newName": "view.html.php",
"type": "customimport"
},
"default_import_custom.php": {
"path": "c0mp0n3nt/admin/views/VIEW/tmpl",
"rename": "new",
"newName": "default.php",
"type": "customimport"
},
"JControllerLegacyHelp.php": { "JControllerLegacyHelp.php": {
"path": "c0mp0n3nt/admin/controllers", "path": "c0mp0n3nt/admin/controllers",
"rename": "new", "rename": "new",

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage componentbuilder.php @subpackage componentbuilder.php
@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check. // Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_componentbuilder')) 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 // Load cms libraries
@ -44,7 +44,7 @@ $document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css')
$document->addScript('components/com_componentbuilder/assets/js/admin.js'); $document->addScript('components/com_componentbuilder/assets/js/admin.js');
// require helper files // require helper files
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php'); JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php'); JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
// import joomla controller library // import joomla controller library

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<config> <config>
<fieldset <fieldset
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
name="global_config" name="global_config"
label="COM_COMPONENTBUILDER_CONFIG_GLOBAL_LABEL" label="COM_COMPONENTBUILDER_CONFIG_GLOBAL_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_GLOBAL_DESC"> description="COM_COMPONENTBUILDER_CONFIG_GLOBAL_DESC">
@ -28,7 +30,7 @@
name="save_history" name="save_history"
type="radio" type="radio"
class="btn-group btn-group-yesno" class="btn-group btn-group-yesno"
default="0" default="1"
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL" label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC" description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
> >
@ -466,6 +468,24 @@
filter="PATH" filter="PATH"
message="Error! Please add folder path here." message="Error! Please add folder path here."
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_HINT" hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_HINT"
/>
<!-- Note_git_folder_path Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_git_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_git_folder_path" />
<!-- Git_folder_path Field. Type: Text. (joomla) -->
<field
type="text"
name="git_folder_path"
label="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_LABEL"
size="70"
maxlength="150"
description="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="false"
filter="PATH"
message="Error! Please add folder path here."
hint="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT"
/> />
</fieldset> </fieldset>
<fieldset <fieldset

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage controller.php @subpackage controller.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_view.php @subpackage admin_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_views.php @subpackage admin_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage ajax.json.php @subpackage ajax.json.php
@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
// load the tasks // load the tasks
$this->registerTask('tableColumns', 'ajax'); $this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax'); $this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getImportScripts', 'ajax');
$this->registerTask('layoutDetails', 'ajax'); $this->registerTask('layoutDetails', 'ajax');
$this->registerTask('templateDetails', 'ajax'); $this->registerTask('templateDetails', 'ajax');
$this->registerTask('snippetDetails', 'ajax'); $this->registerTask('snippetDetails', 'ajax');
@ -70,6 +71,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'tableColumns': case 'tableColumns':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$tableValue = $jinput->get('table', NULL, 'WORD'); $tableValue = $jinput->get('table', NULL, 'WORD');
if($tableValue && $user->id != 0) if($tableValue && $user->id != 0)
{ {
@ -79,9 +81,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -90,9 +96,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -103,6 +109,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'fieldSelectOptions': case 'fieldSelectOptions':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -112,9 +119,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -123,9 +134,47 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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
{
echo "(".json_encode($e).");";
}
}
break;
case 'getImportScripts':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$typeValue = $jinput->get('type', NULL, 'WORD');
if($typeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getImportScripts($typeValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
} }
else else
{ {
@ -136,6 +185,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'layoutDetails': case 'layoutDetails':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', null, 'INT'); $idValue = $jinput->get('id', null, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -145,9 +195,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -156,9 +210,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -169,6 +223,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'templateDetails': case 'templateDetails':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', null, 'INT'); $idValue = $jinput->get('id', null, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -178,9 +233,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -189,9 +248,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -202,6 +261,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'snippetDetails': case 'snippetDetails':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -211,9 +271,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -222,9 +286,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -235,6 +299,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'dynamicValues': case 'dynamicValues':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
$viewValue = $jinput->get('view', NULL, 'WORD'); $viewValue = $jinput->get('view', NULL, 'WORD');
if($idValue && $viewValue && $user->id != 0) if($idValue && $viewValue && $user->id != 0)
@ -245,9 +310,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -256,9 +325,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -269,6 +338,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'dynamicFormDetails': case 'dynamicFormDetails':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -278,9 +348,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -289,9 +363,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -302,6 +376,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'dbTableColumns': case 'dbTableColumns':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$nameValue = $jinput->get('name', NULL, 'WORD'); $nameValue = $jinput->get('name', NULL, 'WORD');
$asValue = $jinput->get('as', NULL, 'WORD'); $asValue = $jinput->get('as', NULL, 'WORD');
$typeValue = $jinput->get('type', NULL, 'INT'); $typeValue = $jinput->get('type', NULL, 'INT');
@ -313,9 +388,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -324,9 +403,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -337,6 +416,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'viewTableColumns': case 'viewTableColumns':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
$asValue = $jinput->get('as', NULL, 'WORD'); $asValue = $jinput->get('as', NULL, 'WORD');
$typeValue = $jinput->get('type', NULL, 'INT'); $typeValue = $jinput->get('type', NULL, 'INT');
@ -348,9 +428,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -359,9 +443,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -372,6 +456,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
case 'fieldOptions': case 'fieldOptions':
try try
{ {
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT'); $idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0) if($idValue && $user->id != 0)
{ {
@ -381,9 +466,13 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
{ {
$result = false; $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)
{
echo json_encode($result);
} }
else else
{ {
@ -392,9 +481,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
catch(Exception $e) 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 else
{ {
@ -406,9 +495,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
else 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 else
{ {

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage compiler.php @subpackage compiler.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage component.php @subpackage component.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage componentbuilder.php @subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage components.php @subpackage components.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_view.php @subpackage custom_admin_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_views.php @subpackage custom_admin_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.php @subpackage dynamic_get.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.php @subpackage dynamic_gets.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage field.php @subpackage field.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fields.php @subpackage fields.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtype.php @subpackage fieldtype.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtypes.php @subpackage fieldtypes.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help.php @subpackage help.php
@ -115,10 +115,10 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">'; $text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">'; $text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
// build the help text // build the help text
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>"; $text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
$text[] = str_replace(array_keys($images),array_values($images),$document->content); $text[] = str_replace(array_keys($images),array_values($images),$document->content);
// end template // end template
$text[] = '</div>'; $text[] = '</div><br /><br />';
$text[] = '</div>'; $text[] = '</div>';
$text[] = "</body>"; $text[] = "</body>";
$text[] = "</html>"; $text[] = "</html>";

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_document.php @subpackage help_document.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage import.php @subpackage import.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layout.php @subpackage layout.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layouts.php @subpackage layouts.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_view.php @subpackage site_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_views.php @subpackage site_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippet.php @subpackage snippet.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippets.php @subpackage snippets.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage template.php @subpackage template.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.0 @version 2.1.20
@build 18th February, 2016 @build 7th September, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage templates.php @subpackage templates.php

View File

@ -0,0 +1,49 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@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
/-----------------------------------------------------------------------------------------------------------------------------*/
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
class PHPExcel_Reader_chunkReadFilter implements PHPExcel_Reader_IReadFilter
{
private $_startRow = 0;
private $_endRow = 0;
/** Set the list of rows that we want to read */
public function setRows($startRow, $chunkSize)
{
$this->_startRow = $startRow;
$this->_endRow = $startRow + $chunkSize;
}
public function readCell($column, $row, $worksheetName = '')
{
// Only read the heading row, and the rows that are configured in $this->_startRow and $this->_endRow
if (($row == 1) || ($row >= $this->_startRow && $row < $this->_endRow)) {
return true;
}
return false;
}
}

View File

@ -7,8 +7,8 @@
* *
**/ **/
// No direct access. // No direct access to this file
defined('_JEXEC') or die; defined('_JEXEC') or die('Restricted access');
class Chartbuilder class Chartbuilder
{ {

View File

@ -1,143 +0,0 @@
(function ($, w, undefined) {
if (w.footable === undefined || w.footable === null)
throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
var defaults = {
filter: {
enabled: true,
input: '.footable-filter',
timeout: 300,
minimum: 2,
disableEnter: false,
filterFunction: function(index) {
var $t = $(this),
$table = $t.parents('table:first'),
filter = $table.data('current-filter').toUpperCase(),
text = $t.find('td').text();
if (!$table.data('filter-text-only')) {
$t.find('td[data-value]').each(function () {
text += $(this).data('value');
});
}
return text.toUpperCase().indexOf(filter) >= 0;
}
}
};
function Filter() {
var p = this;
p.name = 'Footable Filter';
p.init = function (ft) {
p.footable = ft;
if (ft.options.filter.enabled === true) {
if ($(ft.table).data('filter') === false) return;
ft.timers.register('filter');
$(ft.table)
.unbind('.filtering')
.bind({
'footable_initialized.filtering': function (e) {
var $table = $(ft.table);
var data = {
'input': $table.data('filter') || ft.options.filter.input,
'timeout': $table.data('filter-timeout') || ft.options.filter.timeout,
'minimum': $table.data('filter-minimum') || ft.options.filter.minimum,
'disableEnter': $table.data('filter-disable-enter') || ft.options.filter.disableEnter
};
if (data.disableEnter) {
$(data.input).keypress(function (event) {
if (window.event)
return (window.event.keyCode !== 13);
else
return (event.which !== 13);
});
}
$table.bind('footable_clear_filter', function () {
$(data.input).val('');
p.clearFilter();
});
$table.bind('footable_filter', function (event, args) {
p.filter(args.filter);
});
$(data.input).keyup(function (eve) {
ft.timers.filter.stop();
if (eve.which === 27) {
$(data.input).val('');
}
ft.timers.filter.start(function () {
var val = $(data.input).val() || '';
p.filter(val);
}, data.timeout);
});
},
'footable_redrawn.filtering': function (e) {
var $table = $(ft.table),
filter = $table.data('filter-string');
if (filter) {
p.filter(filter);
}
}
})
//save the filter object onto the table so we can access it later
.data('footable-filter', p);
}
};
p.filter = function (filterString) {
var ft = p.footable,
$table = $(ft.table),
minimum = $table.data('filter-minimum') || ft.options.filter.minimum,
clear = !filterString;
//raise a pre-filter event so that we can cancel the filtering if needed
var event = ft.raise('footable_filtering', { filter: filterString, clear: clear });
if (event && event.result === false) return;
if (event.filter && event.filter.length < minimum) {
return; //if we do not have the minimum chars then do nothing
}
if (event.clear) {
p.clearFilter();
} else {
var filters = event.filter.split(' ');
$table.find('> tbody > tr').hide().addClass('footable-filtered');
var rows = $table.find('> tbody > tr:not(.footable-row-detail)');
$.each(filters, function (i, f) {
if (f && f.length > 0) {
$table.data('current-filter', f);
rows = rows.filter(ft.options.filter.filterFunction);
}
});
rows.each(function () {
p.showRow(this, ft);
$(this).removeClass('footable-filtered');
});
$table.data('filter-string', event.filter);
ft.raise('footable_filtered', { filter: event.filter, clear: false });
}
};
p.clearFilter = function () {
var ft = p.footable,
$table = $(ft.table);
$table.find('> tbody > tr:not(.footable-row-detail)').removeClass('footable-filtered').each(function () {
p.showRow(this, ft);
});
$table.removeData('filter-string');
ft.raise('footable_filtered', { clear: true });
};
p.showRow = function (row, ft) {
var $row = $(row), $next = $row.next(), $table = $(ft.table);
if ($table.hasClass('breakpoint') && $row.hasClass('footable-detail-show') && $next.hasClass('footable-row-detail')) {
$row.add($next).show();
ft.createOrUpdateDetailRow(row);
}
else $row.show();
};
}
w.footable.plugins.register(Filter, defaults);
})(jQuery, window);

View File

@ -0,0 +1,4 @@
Copyright 2012 Steven Usher & Brad Vincent
Released under the MIT license
You are free to use FooTable in commercial projects as long as this copyright header is left intact.

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

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