From 290a51dd5ae2e152250fa593005c6d27c194fd53 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 14 Feb 2017 01:24:38 +0200 Subject: [PATCH] Further improved #37 to ensure language strings are set and reversed, also add extra buttons to the compiler page. Major restructure of custom code implementation to make it more stable. Resolved #40 by updating the default field sql values. --- README.md | 12 +- admin/README.txt | 12 +- admin/assets/css/admin.css | 4 +- admin/assets/css/compiler.css | 4 +- admin/assets/css/component.css | 2 +- admin/assets/css/components.css | 2 +- admin/assets/css/custom_code.css | 4 +- admin/assets/css/custom_codes.css | 4 +- admin/assets/css/dashboard.css | 4 +- admin/assets/css/layout.css | 4 +- admin/assets/css/layouts.css | 4 +- admin/compiler/joomla_3/Helper.php | 92 +- admin/compiler/joomla_3/Helper_site.php | 96 +- admin/componentbuilder.php | 4 +- admin/controller.php | 4 +- admin/controllers/ajax.json.php | 84 +- admin/controllers/compiler.php | 19 +- admin/controllers/component.php | 2 +- admin/controllers/componentbuilder.php | 4 +- admin/controllers/components.php | 2 +- admin/controllers/custom_code.php | 4 +- admin/controllers/custom_codes.php | 4 +- admin/controllers/help.php | 4 +- admin/controllers/import.php | 4 +- admin/controllers/layout.php | 4 +- admin/controllers/layouts.php | 4 +- admin/helpers/compiler.php | 341 +---- admin/helpers/compiler/a_Get.php | 1182 +++++++++++++---- admin/helpers/compiler/b_Structure.php | 34 - admin/helpers/compiler/e_Interpretation.php | 30 +- admin/helpers/compiler/f_Infusion.php | 49 +- admin/helpers/componentbuilder.php | 96 +- admin/helpers/headercheck.php | 4 +- admin/helpers/html/batch_.php | 4 +- admin/helpers/indenter.php | 4 +- admin/helpers/js.php | 4 +- admin/helpers/minify.php | 4 +- .../en-GB/en-GB.com_componentbuilder.ini | 45 +- admin/layouts/admin_view/css_fullwidth.php | 4 +- .../admin_view/custom_buttons_fullwidth.php | 4 +- .../admin_view/custom_buttons_left.php | 4 +- .../admin_view/custom_import_fullwidth.php | 4 +- admin/layouts/admin_view/fields_fullwidth.php | 4 +- .../admin_view/javascript_fullwidth.php | 4 +- .../linked_components_fullwidth.php | 4 +- admin/layouts/admin_view/mysql_fullwidth.php | 4 +- admin/layouts/admin_view/mysql_left.php | 4 +- admin/layouts/admin_view/php_fullwidth.php | 4 +- admin/layouts/admin_view/publishing.php | 4 +- admin/layouts/admin_view/publlshing.php | 4 +- admin/layouts/admin_view/settings_above.php | 4 +- admin/layouts/admin_view/settings_left.php | 4 +- admin/layouts/admin_view/settings_right.php | 4 +- admin/layouts/admin_view/settings_under.php | 4 +- admin/layouts/batchselection.php | 4 +- .../component/admin_views_fullwidth.php | 4 +- .../custom_admin_views_fullwidth.php | 4 +- admin/layouts/component/details_above.php | 4 +- admin/layouts/component/details_left.php | 4 +- admin/layouts/component/details_right.php | 4 +- admin/layouts/component/details_under.php | 4 +- .../dynamic_build_beta_fullwidth.php | 4 +- .../dynamic_integration_fullwidth.php | 4 +- .../component/libs_helpers_fullwidth.php | 4 +- admin/layouts/component/mysql_fullwidth.php | 4 +- admin/layouts/component/php_fullwidth.php | 4 +- admin/layouts/component/publishing.php | 4 +- admin/layouts/component/publlshing.php | 4 +- admin/layouts/component/readme_left.php | 4 +- admin/layouts/component/readme_right.php | 4 +- admin/layouts/component/settings_left.php | 4 +- admin/layouts/component/settings_right.php | 4 +- .../component/site_views_fullwidth.php | 4 +- .../custom_buttons_fullwidth.php | 4 +- .../custom_admin_view/custom_buttons_left.php | 4 +- .../custom_script_fullwidth.php | 4 +- .../custom_admin_view/details_above.php | 4 +- .../custom_admin_view/details_fullwidth.php | 4 +- .../custom_admin_view/details_left.php | 4 +- .../custom_admin_view/details_right.php | 4 +- .../custom_admin_view/details_rightside.php | 4 +- .../custom_admin_view/details_under.php | 4 +- .../linked_components_fullwidth.php | 4 +- .../layouts/custom_admin_view/publishing.php | 4 +- .../layouts/custom_admin_view/publlshing.php | 4 +- admin/layouts/custom_code/details_above.php | 7 +- .../layouts/custom_code/details_fullwidth.php | 7 +- admin/layouts/custom_code/details_left.php | 5 +- admin/layouts/custom_code/details_right.php | 4 +- admin/layouts/custom_code/details_under.php | 4 +- admin/layouts/custom_code/publishing.php | 4 +- admin/layouts/custom_code/publlshing.php | 4 +- .../layouts/dynamic_get/abacus_fullwidth.php | 4 +- admin/layouts/dynamic_get/abacus_left.php | 4 +- .../dynamic_get/custom_script_fullwidth.php | 4 +- admin/layouts/dynamic_get/gettable_above.php | 4 +- .../dynamic_get/gettable_fullwidth.php | 4 +- admin/layouts/dynamic_get/gettable_left.php | 4 +- admin/layouts/dynamic_get/gettable_right.php | 4 +- admin/layouts/dynamic_get/gettable_under.php | 4 +- admin/layouts/dynamic_get/publishing.php | 4 +- admin/layouts/dynamic_get/publlshing.php | 4 +- admin/layouts/field/details_fullwidth.php | 4 +- admin/layouts/field/details_left.php | 4 +- admin/layouts/field/details_right.php | 4 +- admin/layouts/field/details_under.php | 4 +- .../field/linked_admin_views_fullwidth.php | 6 +- admin/layouts/field/publishing.php | 4 +- admin/layouts/field/publlshing.php | 4 +- admin/layouts/field/scripts_left.php | 4 +- admin/layouts/field/scripts_right.php | 4 +- admin/layouts/fieldtype/details_left.php | 4 +- admin/layouts/fieldtype/details_right.php | 4 +- admin/layouts/fieldtype/fields_fullwidth.php | 6 +- admin/layouts/fieldtype/publishing.php | 4 +- admin/layouts/fieldtype/publlshing.php | 4 +- admin/layouts/help_document/details_above.php | 4 +- .../help_document/details_fullwidth.php | 4 +- admin/layouts/help_document/details_left.php | 4 +- admin/layouts/help_document/details_right.php | 4 +- admin/layouts/help_document/details_under.php | 4 +- admin/layouts/help_document/publishing.php | 4 +- admin/layouts/help_document/publlshing.php | 4 +- .../layout/custom_script_fullwidth.php | 4 +- admin/layouts/layout/details_fullwidth.php | 4 +- admin/layouts/layout/details_left.php | 4 +- admin/layouts/layout/details_right.php | 4 +- admin/layouts/layout/details_rightside.php | 4 +- admin/layouts/layout/details_under.php | 4 +- admin/layouts/layout/publishing.php | 4 +- admin/layouts/layout/publlshing.php | 4 +- .../site_view/custom_buttons_fullwidth.php | 4 +- admin/layouts/site_view/details_above.php | 4 +- admin/layouts/site_view/details_fullwidth.php | 4 +- admin/layouts/site_view/details_left.php | 4 +- admin/layouts/site_view/details_right.php | 4 +- admin/layouts/site_view/details_rightside.php | 4 +- admin/layouts/site_view/details_under.php | 4 +- .../site_view/javascript_css_fullwidth.php | 4 +- .../site_view/linked_components_fullwidth.php | 4 +- admin/layouts/site_view/php_fullwidth.php | 4 +- admin/layouts/site_view/publishing.php | 4 +- admin/layouts/site_view/publlshing.php | 4 +- admin/layouts/snippet/details_above.php | 4 +- admin/layouts/snippet/details_left.php | 4 +- admin/layouts/snippet/details_right.php | 4 +- admin/layouts/snippet/publishing.php | 4 +- admin/layouts/snippet/publlshing.php | 4 +- .../template/custom_script_fullwidth.php | 4 +- admin/layouts/template/details_fullwidth.php | 4 +- admin/layouts/template/details_left.php | 4 +- admin/layouts/template/details_right.php | 4 +- admin/layouts/template/details_rightside.php | 4 +- admin/layouts/template/details_under.php | 4 +- admin/layouts/template/publishing.php | 4 +- admin/layouts/template/publlshing.php | 4 +- admin/models/ajax.php | 39 +- admin/models/compiler.php | 21 +- admin/models/component.php | 2 +- admin/models/componentbuilder.php | 4 +- admin/models/components.php | 2 +- admin/models/custom_code.php | 4 +- admin/models/custom_codes.php | 49 +- admin/models/field.php | 2 +- admin/models/fields/adminviewfolderlist.php | 4 +- admin/models/fields/adminviews.php | 4 +- admin/models/fields/articles.php | 4 +- admin/models/fields/component.php | 4 +- admin/models/fields/customadminviews.php | 4 +- admin/models/fields/customfilelist.php | 4 +- admin/models/fields/customfolderlist.php | 4 +- admin/models/fields/customgets.php | 4 +- admin/models/fields/dbtables.php | 4 +- admin/models/fields/dynamicgets.php | 4 +- admin/models/fields/fields.php | 4 +- admin/models/fields/fieldsmulti.php | 4 +- admin/models/fields/fieldtypes.php | 4 +- admin/models/fields/maingets.php | 4 +- admin/models/fields/siteviewfolderlist.php | 4 +- admin/models/fields/siteviews.php | 4 +- admin/models/fields/snippets.php | 4 +- admin/models/fieldtype.php | 12 +- admin/models/forms/component.js | 2 +- admin/models/forms/custom_code.js | 149 ++- admin/models/forms/custom_code.xml | 119 +- admin/models/forms/field.js | 80 +- admin/models/forms/help_document.js | 60 +- admin/models/forms/layout.js | 4 +- admin/models/import.php | 4 +- admin/models/layout.php | 4 +- admin/models/layouts.php | 4 +- admin/sql/install.mysql.utf8.sql | 241 ++-- admin/sql/updates/mysql/2.3.2.sql | 1 + admin/sql/updates/mysql/2.3.3.sql | 1 + admin/tables/component.php | 2 +- admin/tables/custom_code.php | 4 +- admin/tables/layout.php | 4 +- admin/views/compiler/tmpl/default.php | 4 +- admin/views/compiler/view.html.php | 38 +- admin/views/component/submitbutton.js | 2 +- admin/views/component/tmpl/edit.php | 2 +- admin/views/component/view.html.php | 6 +- admin/views/componentbuilder/tmpl/default.php | 4 +- ...sed_issues_the_closed_issues_on_github.php | 4 +- .../componentbuilder/tmpl/default_main.php | 4 +- ..._open_issues_the_open_issues_on_github.php | 4 +- .../tmpl/default_readme_information.php | 4 +- ...t_vast_development_method_notice_board.php | 4 +- .../componentbuilder/tmpl/default_vdm.php | 4 +- admin/views/componentbuilder/view.html.php | 4 +- admin/views/components/tmpl/default.php | 2 +- .../components/tmpl/default_batch_body.php | 2 +- .../components/tmpl/default_batch_footer.php | 2 +- admin/views/components/tmpl/default_body.php | 2 +- admin/views/components/tmpl/default_foot.php | 2 +- admin/views/components/tmpl/default_head.php | 2 +- .../views/components/tmpl/default_toolbar.php | 2 +- admin/views/components/view.html.php | 2 +- admin/views/custom_code/submitbutton.js | 4 +- admin/views/custom_code/tmpl/edit.php | 29 +- admin/views/custom_code/view.html.php | 16 +- admin/views/custom_codes/tmpl/default.php | 4 +- .../custom_codes/tmpl/default_batch_body.php | 4 +- .../tmpl/default_batch_footer.php | 4 +- .../views/custom_codes/tmpl/default_body.php | 7 +- .../views/custom_codes/tmpl/default_foot.php | 6 +- .../views/custom_codes/tmpl/default_head.php | 7 +- .../custom_codes/tmpl/default_toolbar.php | 4 +- admin/views/custom_codes/view.html.php | 63 +- admin/views/field/view.html.php | 2 +- admin/views/fieldtype/view.html.php | 2 +- admin/views/import/tmpl/default.php | 4 +- admin/views/import/view.html.php | 4 +- admin/views/layout/submitbutton.js | 4 +- admin/views/layout/tmpl/edit.php | 4 +- admin/views/layout/view.html.php | 4 +- admin/views/layouts/tmpl/default.php | 4 +- .../views/layouts/tmpl/default_batch_body.php | 4 +- .../layouts/tmpl/default_batch_footer.php | 4 +- admin/views/layouts/tmpl/default_body.php | 4 +- admin/views/layouts/tmpl/default_foot.php | 4 +- admin/views/layouts/tmpl/default_head.php | 4 +- admin/views/layouts/tmpl/default_toolbar.php | 4 +- admin/views/layouts/view.html.php | 4 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 34 + script.php | 14 +- 247 files changed, 2394 insertions(+), 1513 deletions(-) create mode 100644 admin/sql/updates/mysql/2.3.2.sql create mode 100644 admin/sql/updates/mysql/2.3.3.sql diff --git a/README.md b/README.md index d8e9834aa..814d3ee16 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Component Builder (2.3.2) +# Component Builder (2.3.4) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.3.2) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.3.4) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -104,12 +104,12 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 11th February, 2017 -+ *Version*: 2.3.2 ++ *Last Build*: 13th February, 2017 ++ *Version*: 2.3.4 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **91443** -+ *File count*: **592** ++ *Line count*: **91942** ++ *File count*: **594** + *Folder count*: **105** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/README.txt b/admin/README.txt index d8e9834aa..814d3ee16 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Component Builder (2.3.2) +# Component Builder (2.3.4) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.3.2) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.3.4) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -104,12 +104,12 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 11th February, 2017 -+ *Version*: 2.3.2 ++ *Last Build*: 13th February, 2017 ++ *Version*: 2.3.4 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **91443** -+ *File count*: **592** ++ *Line count*: **91942** ++ *File count*: **594** + *Folder count*: **105** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index b5692c326..bfa88fe59 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin.css diff --git a/admin/assets/css/compiler.css b/admin/assets/css/compiler.css index 3cdb642db..1ae2c36c8 100644 --- a/admin/assets/css/compiler.css +++ b/admin/assets/css/compiler.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 11 of this MVC - @build 2nd February, 2017 + @version @update number 17 of this MVC + @build 13th February, 2017 @created 1st February, 2017 @package Component Builder @subpackage compiler.css diff --git a/admin/assets/css/component.css b/admin/assets/css/component.css index 27f2d309e..6f33f61a3 100644 --- a/admin/assets/css/component.css +++ b/admin/assets/css/component.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage component.css diff --git a/admin/assets/css/components.css b/admin/assets/css/components.css index 92baa64d6..208b1c53b 100644 --- a/admin/assets/css/components.css +++ b/admin/assets/css/components.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage components.css diff --git a/admin/assets/css/custom_code.css b/admin/assets/css/custom_code.css index b84a4c6fd..9c8b41597 100644 --- a/admin/assets/css/custom_code.css +++ b/admin/assets/css/custom_code.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.css diff --git a/admin/assets/css/custom_codes.css b/admin/assets/css/custom_codes.css index 4f9565b31..63d6ff2fa 100644 --- a/admin/assets/css/custom_codes.css +++ b/admin/assets/css/custom_codes.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 24c26cc5c..64d9964ca 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage dashboard.css diff --git a/admin/assets/css/layout.css b/admin/assets/css/layout.css index 4645a1ea3..402b78a22 100644 --- a/admin/assets/css/layout.css +++ b/admin/assets/css/layout.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage layout.css diff --git a/admin/assets/css/layouts.css b/admin/assets/css/layouts.css index d3f0017b1..1a2536fec 100644 --- a/admin/assets/css/layouts.css +++ b/admin/assets/css/layouts.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage layouts.css diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index aa6de8d60..b86e63b08 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -683,55 +683,67 @@ abstract class ###Component###Helper public static function safeString($string, $type = 'L', $spacer = '_') { - // remove all numbers and replace with english text version (works well only up to a thousand) + // remove all numbers and replace with english text version (works well only up to millions) $string = self::replaceNumbers($string); - + // 0nly continue if we have a string if (self::checkString($string)) { - // remove all other characters - $string = trim($string); - $string = preg_replace('/'.$spacer.'+/', ' ', $string); - $string = preg_replace('/\s+/', ' ', $string); - $string = preg_replace("/[^A-Za-z ]/", '', $string); - // return a string with all first letter of each word uppercase(no undersocre) - if ($type == 'W') - { - return ucwords(strtolower($string)); - } - elseif ($type == 'w') - { - return strtolower($string); - } - elseif ($type == 'Ww') - { - return ucfirst(strtolower($string)); - } - elseif ($type == 'WW') - { - return strtoupper($string); - } - elseif ($type == 'U') - { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return all upper - return strtoupper($string); - } - elseif ($type == 'F') - { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return with first caracter to upper - return ucfirst(strtolower($string)); - } - elseif ($type == 'L') + // remove all other characters + $string = trim($string); + $string = preg_replace('/'.$spacer.'+/', ' ', $string); + $string = preg_replace('/\s+/', ' ', $string); + $string = preg_replace("/[^A-Za-z ]/", '', $string); + // select final adaptations + if ($type === 'L' || $type === 'strtolower') { // replace white space with underscore $string = preg_replace('/\s+/', $spacer, $string); // default is to return lower return strtolower($string); } - + elseif ($type === 'W') + { + // return a string with all first letter of each word uppercase(no undersocre) + return ucwords(strtolower($string)); + } + elseif ($type === 'w' || $type === 'word') + { + // return a string with all lowercase(no undersocre) + return strtolower($string); + } + elseif ($type === 'Ww' || $type === 'Word') + { + // return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre) + return ucfirst(strtolower($string)); + } + elseif ($type === 'WW' || $type === 'WORD') + { + // return a string with all the uppercase(no undersocre) + return strtoupper($string); + } + elseif ($type === 'U' || $type === 'strtoupper') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return all upper + return strtoupper($string); + } + elseif ($type === 'F' || $type === 'ucfirst') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return with first caracter to upper + return ucfirst(strtolower($string)); + } + elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') + { + // convert all words to first letter uppercase + $string = ucwords(strtolower($string)); + // remove white space + $string = preg_replace('/\s+/', '', $string); + // now return first letter lowercase + return lcfirst($string); + } // return string return $string; } diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index b700b2e32..e6c143921 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -675,60 +675,72 @@ abstract class ###Component###Helper public static function safeString($string, $type = 'L', $spacer = '_') { - // remove all numbers and replace with english text version (works well only up to a thousand) - $string = self::replaceNumbers($string); - - if (self::checkString($string)) - { + // remove all numbers and replace with english text version (works well only up to millions) + $string = self::replaceNumbers($string); + // 0nly continue if we have a string + if (self::checkString($string)) + { // remove all other characters $string = trim($string); $string = preg_replace('/'.$spacer.'+/', ' ', $string); $string = preg_replace('/\s+/', ' ', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string); - // return a string with all first letter of each word uppercase(no undersocre) - if ($type == 'W') - { - return ucwords(strtolower($string)); - } - elseif ($type == 'w') - { - return strtolower($string); - } - elseif ($type == 'Ww') - { - return ucfirst(strtolower($string)); - } - elseif ($type == 'WW') - { - return strtoupper($string); - } - elseif ($type == 'U') + // select final adaptations + if ($type === 'L' || $type === 'strtolower') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // default is to return lower + return strtolower($string); + } + elseif ($type === 'W') { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return all upper - return strtoupper($string); + // return a string with all first letter of each word uppercase(no undersocre) + return ucwords(strtolower($string)); } - elseif ($type == 'F') + elseif ($type === 'w' || $type === 'word') { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return with first caracter to upper + // return a string with all lowercase(no undersocre) + return strtolower($string); + } + elseif ($type === 'Ww' || $type === 'Word') + { + // return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre) return ucfirst(strtolower($string)); } - elseif ($type == 'L') + elseif ($type === 'WW' || $type === 'WORD') { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // default is to return lower - return strtolower($string); + // return a string with all the uppercase(no undersocre) + return strtoupper($string); } - - // return string - return $string; - } - // not a string - return ''; + elseif ($type === 'U' || $type === 'strtoupper') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return all upper + return strtoupper($string); + } + elseif ($type === 'F' || $type === 'ucfirst') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return with first caracter to upper + return ucfirst(strtolower($string)); + } + elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') + { + // convert all words to first letter uppercase + $string = ucwords(strtolower($string)); + // remove white space + $string = preg_replace('/\s+/', '', $string); + // now return first letter lowercase + return lcfirst($string); + } + // return string + return $string; + } + // not a string + return ''; } public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40) diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index 27fc706d1..ebf4861f7 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/controller.php b/admin/controller.php index 3505d4c34..98837c8d1 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage controller.php diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index ef084e6e8..a6301013f 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage ajax.json.php @@ -54,6 +54,8 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('dynamicFormDetails', 'ajax'); $this->registerTask('dbTableColumns', 'ajax'); $this->registerTask('viewTableColumns', 'ajax'); + $this->registerTask('checkFunctionName', 'ajax'); + $this->registerTask('usedin', 'ajax'); $this->registerTask('fieldOptions', 'ajax'); } @@ -530,6 +532,84 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'checkFunctionName': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $functioNameValue = $jinput->get('functioName', NULL, 'STRING'); + $idValue = $jinput->get('id', NULL, 'INT'); + if($functioNameValue && $idValue && $user->id != 0) + { + $result = $this->getModel('ajax')->checkFunctionName($functioNameValue, $idValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; + case 'usedin': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $functioNameValue = $jinput->get('functioName', NULL, 'WORD'); + $idValue = $jinput->get('id', NULL, 'INT'); + if($functioNameValue && $idValue && $user->id != 0) + { + $result = $this->getModel('ajax')->usedin($functioNameValue, $idValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'fieldOptions': try { diff --git a/admin/controllers/compiler.php b/admin/controllers/compiler.php index 39c3153f1..5ef040ea3 100644 --- a/admin/controllers/compiler.php +++ b/admin/controllers/compiler.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 11 of this MVC - @build 2nd February, 2017 + @version @update number 17 of this MVC + @build 13th February, 2017 @created 1st February, 2017 @package Component Builder @subpackage compiler.php @@ -66,15 +66,17 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin if($user->authorise('core.admin', 'com_componentbuilder')) { // get the post values - $jinput = JFactory::getApplication()->input; - $componentId = $jinput->post->get('component', 0, 'INT'); - $version = $jinput->post->get('version', 0, 'INT'); - $addBackup = $jinput->post->get('backup', 0, 'INT'); - $addGit = $jinput->post->get('git', 0, 'INT'); + $jinput = JFactory::getApplication()->input; + $componentId = $jinput->post->get('component', 0, 'INT'); + $version = $jinput->post->get('version', 0, 'INT'); + $addBackup = $jinput->post->get('backup', 0, 'INT'); + $addGit = $jinput->post->get('git', 0, 'INT'); + $addPlaceholders = $jinput->post->get('placeholders', 2, 'INT'); + $debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT'); // include component compiler require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php'; $model = $this->getModel('compiler'); - if ($model->builder($version,$componentId,$addBackup,$addGit)) + if ($model->builder($version,$componentId,$addBackup,$addGit,$addPlaceholders,$debugLinenr)) { $cache = JFactory::getCache('mod_menu'); $cache->clean(); @@ -143,6 +145,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin $message .= 'URL: '.$url.'

'; $message .= 'Hey! you can also download the file right now!
Download

'; $message .= '

Remember! This file is in your tmp folder and therefore publicly accessible untill you click [Clear tmp]!

'; + $message .= '

Compilation took '.$counter['time'].' seconds to complete.

'; // set redirect $this->setRedirect($redirect_url,$message,'message'); $app->setUserState('com_componentbuilder.extension_name', $counter['filename']); diff --git a/admin/controllers/component.php b/admin/controllers/component.php index fb632e2b9..088e10162 100644 --- a/admin/controllers/component.php +++ b/admin/controllers/component.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage component.php diff --git a/admin/controllers/componentbuilder.php b/admin/controllers/componentbuilder.php index c21f1c522..be36f9921 100644 --- a/admin/controllers/componentbuilder.php +++ b/admin/controllers/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/controllers/components.php b/admin/controllers/components.php index cffcd9d40..51d6df591 100644 --- a/admin/controllers/components.php +++ b/admin/controllers/components.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage components.php diff --git a/admin/controllers/custom_code.php b/admin/controllers/custom_code.php index 45c2f6750..aaf6d71b4 100644 --- a/admin/controllers/custom_code.php +++ b/admin/controllers/custom_code.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.php diff --git a/admin/controllers/custom_codes.php b/admin/controllers/custom_codes.php index 666957e22..a282dd7d2 100644 --- a/admin/controllers/custom_codes.php +++ b/admin/controllers/custom_codes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.php diff --git a/admin/controllers/help.php b/admin/controllers/help.php index 9ee2b2d75..8849df99d 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage help.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 785a77acb..d8755bc30 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage import.php diff --git a/admin/controllers/layout.php b/admin/controllers/layout.php index e828070f1..87a9a2045 100644 --- a/admin/controllers/layout.php +++ b/admin/controllers/layout.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage layout.php diff --git a/admin/controllers/layouts.php b/admin/controllers/layouts.php index b9433afef..248bf5008 100644 --- a/admin/controllers/layouts.php +++ b/admin/controllers/layouts.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage layouts.php diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index fccc06561..c59314724 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -41,6 +41,15 @@ class Compiler extends Infusion */ private $tempPath; + /* + * The timer + * + * @var string + */ + private $time_start; + private $time_end; + public $secondsCompiled; + public $filepath = ''; // fixed pathes protected $dynamicIntegration = false; @@ -53,7 +62,8 @@ class Compiler extends Infusion */ public function __construct($config = array ()) { -// $time_start = microtime(true); + // to check the compiler speed + $this->time_start = microtime(true); // first we run the perent constructor if (parent::__construct($config)) { @@ -88,46 +98,27 @@ class Compiler extends Infusion { return false; } - // we can remove all undeeded data - $this->freeMemory(); - // check if this component is install on the current website - if ($paths = $this->getLocalInstallPaths()) - { - // start Automatic import of custom code - $userId = JFactory::getUser()->id; - $today = JFactory::getDate()->toSql(); - // Get a db connection. - $db = JFactory::getDbo(); - // get the custom code from installed files - $this->customCodeFactory($paths, $db, $userId, $today); - } - // now add the other custom code by placeholder - if (ComponentbuilderHelper::checkArray($this->addCustomCodeAt)) - { - // load error messages incase code can not be added - $app = JFactory::getApplication(); - $this->addCustomCodeViaPlaceholders($app); - } - // check if we have custom code to add - $this->getCustomCode(); // now insert into the new files - if (ComponentbuilderHelper::checkArray($this->customCode)) - { - // load error messages incase code can not be added - $app = JFactory::getApplication(); - $this->addCustomCode($app); + if ($this->getCustomCode()) + { + $this->addCustomCode(); } + // set the lang data now + $this->setLangFileData(); // move the update server into place $this->setUpdateServer(); + // build read me + $this->buildReadMe(); // zip the component if (!$this->zipComponent()) { - // done + // done with error return false; } -// $time_end = microtime(true); -// $time = $time_end - $time_start; -// var_dump("Did Test in ($time seconds)");die; + // end the timer here + $this->time_end = microtime(true); + $this->secondsCompiled = $this->time_end - $this->time_start; + // completed the compilation return true; } return false; @@ -159,7 +150,9 @@ class Compiler extends Infusion protected function updateFiles() { if (isset($this->newFiles['static']) && ComponentbuilderHelper::checkArray($this->newFiles['static']) && isset($this->newFiles['dynamic']) && ComponentbuilderHelper::checkArray($this->newFiles['dynamic'])) - { + { + // we don't update lang now since we will still posible add custom code + $langCheck = 'en-GB.com_'.$this->fileContentStatic['###component###'].'.'; // get the bom file $bom = JFile::read($this->bomPath); // first we do the static files @@ -167,6 +160,12 @@ class Compiler extends Infusion { if (JFile::exists($static['path'])) { + // skip lang files and store for later + if (strpos($static['path'], $langCheck)) + { + $this->langFiles[] = $static; + continue; + } $this->fileContentStatic['###FILENAME###'] = $static['name']; $php = ''; if (ComponentbuilderHelper::checkFileType($static['name'],'php')) @@ -179,16 +178,12 @@ class Compiler extends Infusion list($wast,$code) = explode('###BOM###',$string); $string = $php.$bom.$code; $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); - // add custom Code by placeholder if found - $this->getPlaceHolderKeys($static['path'], $answer); // add to zip array $this->writeFile($static['path'],$answer); } else { $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); - // add custom Code by placeholder if found - $this->getPlaceHolderKeys($static['path'], $answer); // add to zip array $this->writeFile($static['path'],$answer); } @@ -221,8 +216,6 @@ class Compiler extends Infusion $string = $php.$bom.$code; $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); - // add custom Code by placeholder if found - $this->getPlaceHolderKeys($file['path'], $answer, $view); // add to zip array $this->writeFile($file['path'],$answer); } @@ -230,8 +223,6 @@ class Compiler extends Infusion { $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); - // add custom Code by placeholder if found - $this->getPlaceHolderKeys($file['path'], $answer, $view); // add to zip array $this->writeFile($file['path'],$answer); } @@ -245,155 +236,10 @@ class Compiler extends Infusion } // free up some memory unset($this->newFiles['dynamic']); - // do a final run to update the readme file - $two = 0; - foreach ($this->newFiles['static'] as $static) - { - if (('README.md' === $static['name'] || 'README.txt' === $static['name']) && $this->componentData->addreadme && JFile::exists($static['path'])) - { - $this->buildReadMe($static['path']); - $two++; - } - if ($two == 2) - { - break; - } - } return true; } return false; } - - protected function getPlaceHolderKeys(&$file, &$content, &$view = '') - { - // check if line has custom code place holder - if (strpos($content, '[CUSTO'.'MCODE=') !== false) - { - if (!isset($this->addCustomCodeAt[$file])) - { - $this->addCustomCodeAt[$file] = array(); - $this->addCustomCodeAt[$file]['ids'] = array(); - $this->addCustomCodeAt[$file]['args'] = array(); - $this->addCustomCodeAt[$file]['view'] = $view; - } - $found = ComponentbuilderHelper::getAllBetween($content, '[CUSTO'.'MCODE=', ']'); - if (ComponentbuilderHelper::checkArray($found)) - { - foreach ($found as $key) - { - // check if we have args - if (is_numeric($key)) - { - $id = (int) $key; - } - elseif (strpos($key, '+') !== false) - { - $array = explode('+', $key); - // set ID - $id = (int) $array[0]; - // load args for this ID - if (isset($array[1])) - { - if (!isset($this->addCustomCodeAt[$file]['args'][$id])) - { - $this->addCustomCodeAt[$file]['args'][$id] = array(); - } - // only load if not already loaded - if (!isset($this->addCustomCodeAt[$file]['args'][$id][$key])) - { - if (strpos($array[1], ',') !== false) - { - $this->addCustomCodeAt[$file]['args'][$id][$key] = array_map('trim', explode(',', $array[1])); - } - elseif (ComponentbuilderHelper::checkString($array[1])) - { - $this->addCustomCodeAt[$file]['args'][$id][$key] = array(); - $this->addCustomCodeAt[$file]['args'][$id][$key][] = trim($array[1]); - } - } - } - } - else - { - continue; - } - $this->addCustomCodeAt[$file]['ids'][$id] = $id; - } - } - } - } - - protected function freeMemory() - { - // free up some memory - unset($this->newFiles['static']); - unset($this->customScriptBuilder); - unset($this->permissionCore); - unset($this->permissionDashboard); - unset($this->componentData->admin_views); - unset($this->componentData->site_views); - unset($this->componentData->custom_admin_views); - unset($this->componentData->config); - unset($this->joomlaVersionData); - // unset($this->langContent); - unset($this->dbKeys); - unset($this->permissionBuilder); - unset($this->layoutBuilder); - unset($this->historyBuilder); - unset($this->aliasBuilder); - unset($this->titleBuilder); - unset($this->customBuilderList); - unset($this->hiddenFieldsBuilder); - unset($this->intFieldsBuilder); - unset($this->dynamicfieldsBuilder); - unset($this->maintextBuilder); - unset($this->customFieldLinksBuilder); - unset($this->setScriptUserSwitch); - unset($this->categoryBuilder); - unset($this->catCodeBuilder); - unset($this->checkboxBuilder); - unset($this->jsonItemBuilder); - unset($this->base64Builder); - unset($this->basicEncryptionBuilder); - unset($this->advancedEncryptionBuilder); - unset($this->getItemsMethodListStringFixBuilder); - unset($this->getItemsMethodEximportStringFixBuilder); - unset($this->selectionTranslationFixBuilder); - unset($this->listBuilder); - unset($this->customBuilder); - unset($this->editBodyViewScriptBuilder); - unset($this->queryBuilder); - unset($this->sortBuilder); - unset($this->searchBuilder); - unset($this->filterBuilder); - unset($this->fieldsNames); - unset($this->siteFields); - unset($this->siteFieldData); - unset($this->customFieldScript); - unset($this->configFieldSets); - unset($this->jsonStringBuilder); - unset($this->importCustomScripts); - unset($this->eximportView); - unset($this->uninstallBuilder); - unset($this->listColnrBuilder); - unset($this->customFieldBuilder); - unset($this->permissionFields); - unset($this->getAsLookup); - unset($this->secondRunAdmin); - unset($this->uninstallScriptBuilder); - unset($this->buildCategories); - unset($this->iconBuilder); - unset($this->validationFixBuilder); - unset($this->targetRelationControl); - unset($this->targetControlsScriptChecker); - unset($this->accessBuilder); - unset($this->tabCounter); - unset($this->linkedAdminViews); - unset($this->uniquekeys); - unset($this->uniquecodes); - $this->unsetNow('_adminViewData'); - $this->unsetNow('_fieldData'); - } /** * move the local update server xml file to a remote ftp server @@ -457,7 +303,26 @@ class Compiler extends Infusion $this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL']; } - private function buildReadMe($path) + private function buildReadMe() + { + // do a final run to update the readme file + $two = 0; + foreach ($this->newFiles['static'] as $static) + { + if (('README.md' === $static['name'] || 'README.txt' === $static['name']) && $this->componentData->addreadme && JFile::exists($static['path'])) + { + $this->setReadMe($static['path']); + $two++; + } + if ($two == 2) + { + break; + } + } + unset($this->newFiles['static']); + } + + private function setReadMe($path) { // set readme data if not set already if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount) @@ -672,98 +537,10 @@ class Compiler extends Infusion return false; } - protected function addCustomCodeViaPlaceholders($app) - { - // reset all these - $this->clearFromPlaceHolders('view'); - foreach ($this->addCustomCodeAt as $path => $item) - { - if (ComponentbuilderHelper::checkString($item['view'])) - { - $this->placeholders['[[[view]]]'] = $item['view']; - } - elseif (isset($this->placeholders['[[[view]]]'])) - { - unset($this->placeholders['[[[view]]]']); - } - if ($this->getCustomCode($item['ids'])) - { - $code = array(); - foreach($this->customCode as $dbitem) - { - $this->buildCustomCodeForPlaceholders($item, $dbitem, $code); - } - // now update the file - $string = JFile::read($path); - $answer = $this->setPlaceholders($string, $code); - $this->writeFile($path,$answer); - } - else - { - $app->enqueueMessage(JText::sprintf('Custom code could not be added to %s
Since there where no publish code returned from the database.', $path), 'warning'); - } - } - } - - protected function buildCustomCodeForPlaceholders(&$at, &$item, &$code) - { - // check if there is args for this code - if (isset($at['args'][$item['id']]) && ComponentbuilderHelper::checkArray($at['args'][$item['id']])) - { - // since we have args we cant update this code via editor (TODO) - $placeholder = $this->getPlaceHolder(3, null); - // we have args and so need to load each - foreach ($at['args'][$item['id']] as $key => $args) - { - $this->setThesePlaceHolders('arg', $args); - $code['[CUSTOM'.'CODE='.$key.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; - } - } - else - { - // check what type of place holders we should load here (if view is being updated then we can't use inserted) - $placeholderType = 2; - if (strpos($item['code'], '[[[view]]]') !== false) - { - // since we have views we can't update this code via editor (TODO) - $placeholderType = 3; - } - // if now ars were found, clear it - $this->clearFromPlaceHolders('arg'); - // load args for this code - $placeholder = $this->getPlaceHolder($placeholderType, $item['id']); - $code['[CUSTOM'.'CODE='.$item['id'].']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; - } - } - - protected function setThesePlaceHolders($key, $values) - { - // aways fist reset these - $this->clearFromPlaceHolders($key); - if (ComponentbuilderHelper::checkArray($values)) - { - $number = 0; - foreach ($values as $value) - { - $this->placeholders['[[['.$key.$number.']]]'] = $value; - $number++; - } - } - } - - protected function clearFromPlaceHolders($like) - { - foreach ($this->placeholders as $something => $value) - { - if (stripos($something, $like) !== false) - { - unset($this->placeholders[$something]); - } - } - } - - protected function addCustomCode($app) + protected function addCustomCode() { + // load error messages incase code can not be added + $app = JFactory::getApplication(); // reset all these $this->clearFromPlaceHolders('view'); $this->clearFromPlaceHolders('arg'); @@ -860,8 +637,8 @@ class Compiler extends Infusion } if ($found) { - $placeholder = $this->getPlaceHolder($target['type'], $target['id']); - $data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders). $placeholder['end']; + $placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']); + $data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders). $placeholder['end'] . PHP_EOL; if ($target['type'] == 2) { // found it now add code from the next line @@ -870,7 +647,7 @@ class Compiler extends Infusion elseif ($target['type'] == 1 && $foundEnd) { // found it now add code from the next line - $this->addDataToFile($file, $data . PHP_EOL, $bites, (int) array_sum($replace)); + $this->addDataToFile($file, $data, $bites, (int) array_sum($replace)); } else { @@ -901,7 +678,7 @@ class Compiler extends Infusion $code = explode(PHP_EOL, $target['code']); $code = PHP_EOL."// " .implode(PHP_EOL."// ",$code). PHP_EOL; // get place holders - $placeholder = $this->getPlaceHolder($target['type'], $target['id']); + $placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']); // build the data $data = $placeholder['start'] . $code . $placeholder['end']. PHP_EOL; // get the bites before insertion diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 9915aeac6..0add57df3 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -38,6 +38,13 @@ class Get */ public $params; + /** + * The placeholders + * + * @var array + */ + public $placeholders = array(); + /** * The Compiler Path * @@ -52,27 +59,45 @@ class Get */ public $componentData; - /* The custom script placeholders - we use the (xxx) to avoid detection it should be (***) + /*********************************************************************************************** + * The custom script placeholders - we use the (xxx) to avoid detection it should be (***) + * ##################################---> PHP/JS <---#################################### * - * New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/ - * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/ + * New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/ + * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/ * - * //////////////////////////// when JCB adds it back /////////////////////////////// - * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx///23 /xxx[/INSERTED$$$$]xxx/ - * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx///25 /xxx[/REPLACED$$$$]xxx/ + * //////////////////////////////// when JCB adds it back ////////////////////////////////// + * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//x23x/ /xxx[/INSERTED$$$$]xxx/ + * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//x25x/ /xxx[/REPLACED$$$$]xxx/ * - * ///////////////////////// changeing existing custom code ///////////////////////// - * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx///23 /xxx[/INSERTED<>$$$$]xxx/ - * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx///25 /xxx[/REPLACED<>$$$$]xxx/ + * /////////////////////////////// changeing existing custom code ///////////////////////// + * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//x23x/ /xxx[/INSERTED<>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//x25x/ /xxx[/REPLACED<>$$$$]xxx/ * - * //23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! + * The custom script placeholders - we use the (==) to avoid detection it should be (--) + * ###################################---> HTML <---##################################### * - * @var array - ******************************************************************************************/ - protected $customCodePlaceholders = array(1 => 'REPLACE<>$$$$]', + * New Insert Code = $$$$]==> $$$$]==> + * New Replace Code = $$$$]==> $$$$]==> + * + * ///////////////////////////////// when JCB adds it back /////////////////////////////// + * JCB Add Inserted Code = + * JCB Add Replaced Code = + * + * //////////////////////////// changeing existing custom code /////////////////////////// + * Update Inserted Code = $$$$]==> $$$$]==> + * Update Replaced Code = $$$$]==> $$$$]==> + * + * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * @var array + ***********************************************************************************************/ + protected $customCodePlaceholders = array( + 1 => 'REPLACE<>$$$$]', 2 => 'INSERT<>$$$$]', 3 => 'REPLACED<>$$$$]', - 4 => 'INSERTED<>$$$$]'); + 4 => 'INSERTED<>$$$$]' + ); /** * The custom code to be added @@ -81,6 +106,27 @@ class Get */ public $customCode; + /** + * The custom code to be added + * + * @var array + */ + protected $customCodeData = array(); + + /** + * The function name memory ids + * + * @var array + */ + public $functionNameMemory = array(); + + /** + * The custom code for local memory + * + * @var array + */ + public $customCodeMemory = array(); + /** * The custom code in local files that aready exist in system * @@ -100,7 +146,14 @@ class Get * * @var array */ - protected $codeAreadyDone = array(); + protected $codeAreadyDone = array(); + + /* + * The line numbers Switch + * + * @var boolean + */ + public $loadLineNr = false; /** * The Language prefix @@ -123,6 +176,27 @@ class Get */ public $componentCodeName; + /** + * The Component ID + * + * @var int + */ + public $componentID; + + /** + * The current user + * + * @var array + */ + public $user; + + /** + * The database object + * + * @var array + */ + public $db; + /** * The Component version * @@ -373,10 +447,38 @@ class Get $this->params = JComponentHelper::getParams('com_componentbuilder'); // load the compiler path $this->compilerPath = $this->params->get('compiler_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/compiler'); - // get the component data - $this->componentData = $this->getComponentData($config['componentId']); - - return true; + // set the component ID + $this->componentID = (int) $config['componentId']; + // set this components code name + if ($name_code = ComponentbuilderHelper::getVar('component', $this->componentID, 'id', 'name_code')) + { + // set lang prefix + $this->langPrefix .= ComponentbuilderHelper::safeString($name_code,'U'); + // set component code name + $this->componentCodeName = ComponentbuilderHelper::safeString($name_code); + // set if placeholders should be added to customcode + $global = ((int) ComponentbuilderHelper::getVar('component', $this->componentID, 'id', 'add_placeholders') == 1) ? true:false; + $this->addPlaceholders = ((int) $config['addPlaceholders'] == 0) ? false : (((int) $config['addPlaceholders'] == 1) ? true : $global); + // set if line numbers should be added to comments + $global = ((int) ComponentbuilderHelper::getVar('component', $this->componentID, 'id', 'debug_linenr') == 1) ? true:false; + $this->loadLineNr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global); + // set the current user + $this->user = JFactory::getUser(); + // Get a db connection. + $this->db = JFactory::getDbo(); + // check if this component is install on the current website + if ($paths = $this->getLocalInstallPaths()) + { + // start Automatic import of custom code + $today = JFactory::getDate()->toSql(); + // get the custom code from installed files + $this->customCodeFactory($paths, $today); + } + // get the component data + $this->componentData = $this->getComponentData(); + + return true; + } } return false; } @@ -406,27 +508,20 @@ class Get * @return oject The component data * */ - public function getComponentData($id) + public function getComponentData() { - // Get a db connection. - $db = JFactory::getDbo(); - // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $query->select('a.*'); $query->from('#__componentbuilder_component AS a'); - $query->where($db->quoteName('a.id') . ' = '. $db->quote($id)); + $query->where($this->db->quoteName('a.id') . ' = '. (int) $this->componentID); // Reset the query using our newly populated query object. - $db->setQuery($query); + $this->db->setQuery($query); // Load the results as a list of stdClass objects - $component = $db->loadObject(); - // set lang prefix - $this->langPrefix .= ComponentbuilderHelper::safeString($component->name_code,'U'); - // set component code name - $this->componentCodeName = ComponentbuilderHelper::safeString($component->name_code); + $component = $this->db->loadObject(); // set component sales name $component->sales_name = ComponentbuilderHelper::safeString($component->system_name); // ensure version naming is correct @@ -700,7 +795,7 @@ class Get { if (isset($component->{'add_'.$scriptMethod.'_'.$scriptType}) && $component->{'add_'.$scriptMethod.'_'.$scriptType} == 1) { - $this->customScriptBuilder[$scriptMethod][$scriptType] = $this->setCustomContentLang(base64_decode($component->{$scriptMethod.'_'.$scriptType})); + $this->customScriptBuilder[$scriptMethod][$scriptType] = $this->setDynamicValues(base64_decode($component->{$scriptMethod.'_'.$scriptType})); } else { @@ -713,7 +808,7 @@ class Get if ($component->add_php_helper_admin == 1) { $this->lang = 'admin'; - $this->customScriptBuilder['component_php_helper_admin'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_admin)); + $this->customScriptBuilder['component_php_helper_admin'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_admin)); } else { @@ -724,7 +819,7 @@ class Get if ($component->add_admin_event == 1) { $this->lang = 'admin'; - $this->customScriptBuilder['component_php_admin_event'] = $this->setCustomContentLang(base64_decode($component->php_admin_event)); + $this->customScriptBuilder['component_php_admin_event'] = $this->setDynamicValues(base64_decode($component->php_admin_event)); } else { @@ -735,7 +830,7 @@ class Get if ($component->add_php_helper_both == 1) { $this->lang = 'both'; - $this->customScriptBuilder['component_php_helper_both'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_both)); + $this->customScriptBuilder['component_php_helper_both'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_both)); } else { @@ -745,7 +840,7 @@ class Get if ($component->add_php_helper_site == 1) { $this->lang = 'site'; - $this->customScriptBuilder['component_php_helper_site'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_site)); + $this->customScriptBuilder['component_php_helper_site'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_site)); } else { @@ -756,7 +851,7 @@ class Get if ($component->add_site_event == 1) { $this->lang = 'site'; - $this->customScriptBuilder['component_php_site_event'] = $this->setCustomContentLang(base64_decode($component->php_site_event)); + $this->customScriptBuilder['component_php_site_event'] = $this->setDynamicValues(base64_decode($component->php_site_event)); } else { @@ -795,7 +890,7 @@ class Get $nowLang = $this->lang; $this->lang = 'admin'; // load the php for the dashboard model - $component->php_dashboard_methods = $this->setCustomContentLang(base64_decode($component->php_dashboard_methods)); + $component->php_dashboard_methods = $this->setDynamicValues(base64_decode($component->php_dashboard_methods)); // check if dashboard_tab is set $dashboard_tab = json_decode($component->dashboard_tab,true); if (ComponentbuilderHelper::checkArray($dashboard_tab)) @@ -807,7 +902,7 @@ class Get { if ('html' === $option) { - $value = $this->setCustomContentLang($value); + $value = $this->setDynamicValues($value); } $component->dashboard_tab[$nr][$option] = $value; } @@ -916,27 +1011,28 @@ class Get { if (!isset($this->_adminViewData[$id])) { - // Get a db connection. - $db = JFactory::getDbo(); - // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $query->select('a.*'); $query->from('#__componentbuilder_admin_view AS a'); - $query->where($db->quoteName('a.id') . ' = '. (int) $id); + $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); // Reset the query using our newly populated query object. - $db->setQuery($query); + $this->db->setQuery($query); // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $view = $db->loadObject(); + $view = $this->db->loadObject(); // reset fields $view->fields = array(); // setup view name to use in storing the data $name_single = ComponentbuilderHelper::safeString($view->name_single); $name_list = ComponentbuilderHelper::safeString($view->name_list); // setup token check + if (!isset($this->customScriptBuilder['token'])) + { + $this->customScriptBuilder['token'] = array(); + } $this->customScriptBuilder['token'][$name_single] = false; $this->customScriptBuilder['token'][$name_list] = false; // load the values form params @@ -1115,7 +1211,7 @@ class Get { if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1) { - $view->$scripter = $this->setCustomContentLang(base64_decode($view->$scripter)); + $view->$scripter = $this->setDynamicValues(base64_decode($view->$scripter)); $scripter_target = str_replace('javascript_', '', $scripter); if (!isset($this->customScriptBuilder[$scripter_target][$name_single])) { @@ -1126,7 +1222,8 @@ class Get $this->customScriptBuilder[$scripter_target][$name_single] = ''; } $this->customScriptBuilder[$scripter_target][$name_single] .= $view->$scripter; - if (strpos($view->$scripter,"token") !== false && strpos($view->$scripter,"task=ajax") !== false) + if (strpos($view->$scripter,"token") !== false || strpos($view->$scripter,"task=ajax") !== false || + strpos($this->$scripter,"[CUSTOM"."CODE=") !== false) // <-- since it could have ajax in it, and we can know for sure at this point { if (!$this->customScriptBuilder['token'][$name_single]) { @@ -1156,20 +1253,21 @@ class Get { if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1) { - $this->customScriptBuilder[$scripter][$name_single] = $this->setCustomContentLang(base64_decode($view->$scripter)); + $this->customScriptBuilder[$scripter][$name_single] = $this->setDynamicValues(base64_decode($view->$scripter)); unset($view->$scripter); } } // add the custom buttons if (isset($view->add_custom_button) && $view->add_custom_button == 1) { - if (ComponentbuilderHelper::checkString($view->php_model)) + if (ComponentbuilderHelper::checkString($view->php_model) && $view->php_mode !== '//') { - $view->php_model = base64_decode($view->php_model); - $view->php_model = $this->setCustomContentLang($view->php_model); + $view->php_model = $this->setDynamicValues(base64_decode($view->php_model)); } - $view->php_controller = base64_decode($view->php_controller); - $view->php_controller = $this->setCustomContentLang($view->php_controller); + if (ComponentbuilderHelper::checkString($view->php_controller) && trim($view->php_controller) !== '//') + { + $view->php_controller = $this->setDynamicValues(base64_decode($view->php_controller)); + } // set the button array $buttons = json_decode($view->custom_button,true); unset($view->custom_button); @@ -1193,7 +1291,7 @@ class Get { if (isset($view->$importScripter) && strlen($view->$importScripter) > 0) { - $this->customScriptBuilder[$importScripter]['import_'.$name_list] = $this->setCustomContentLang(base64_decode($view->$importScripter)); + $this->customScriptBuilder[$importScripter]['import_'.$name_list] = $this->setDynamicValues(base64_decode($view->$importScripter)); unset($view->$importScripter); } } @@ -1202,10 +1300,12 @@ class Get // add_Ajax for this view if (isset($view->add_php_ajax) && $view->add_php_ajax == 1) { + // insure the token is added to edit view atleast + $this->customScriptBuilder['token'][$name_single] = true; $addAjaxSite = false; if (isset($this->siteEditView[$id]) && $this->siteEditView[$id]) { - // we should add this site ajax to fron ajax + // we should add this site ajax to front ajax $addAjaxSite = true; if (!isset($this->addSiteAjax) || !$this->addSiteAjax) { @@ -1232,11 +1332,11 @@ class Get } if (ComponentbuilderHelper::checkString($view->php_ajaxmethod)) { + $this->customScriptBuilder['admin']['ajax_model'][$name_single] = $this->setDynamicValues(base64_decode($view->php_ajaxmethod)); if ($addAjaxSite) { - $this->customScriptBuilder['site']['ajax_model'][$name_single] = $this->setCustomContentLang(base64_decode($view->php_ajaxmethod)); + $this->customScriptBuilder['site']['ajax_model'][$name_single] = $this->customScriptBuilder['admin']['ajax_model'][$name_single]; } - $this->customScriptBuilder['admin']['ajax_model'][$name_single] = $this->setCustomContentLang(base64_decode($view->php_ajaxmethod)); // unset anyway unset($view->php_ajaxmethod); $this->addAjax = true; @@ -1275,21 +1375,18 @@ class Get */ public function getCustomViewData($id, $table = 'site_view') { - // Get a db connection. - $db = JFactory::getDbo(); - // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $query->select('a.*'); $query->from('#__componentbuilder_'.$table.' AS a'); - $query->where($db->quoteName('a.id') . ' = '. (int) $id); + $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); // Reset the query using our newly populated query object. - $db->setQuery($query); + $this->db->setQuery($query); // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $view = $db->loadObject(); + $view = $this->db->loadObject(); if ($table === 'site_view') { $this->lang = 'site'; @@ -1299,8 +1396,7 @@ class Get $this->lang = 'admin'; } // set the default data - $view->default = base64_decode($view->default); - $view->default = $this->setCustomContentLang($view->default); + $view->default = $this->setDynamicValues(base64_decode($view->default)); // fix alias to use in code $view->code = $this->uniqueCode(ComponentbuilderHelper::safeString($view->codename)); $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); @@ -1348,8 +1444,7 @@ class Get { if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1) { - $view->$scripter = base64_decode($view->$scripter); - $view->$scripter = $this->setCustomContentLang($view->$scripter); + $view->$scripter = $this->setDynamicValues(base64_decode($view->$scripter)); // set uikit to views $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->$scripter,$this->uikitComp[$view->code]); @@ -1412,7 +1507,7 @@ class Get if (ComponentbuilderHelper::checkString($view->php_ajaxmethod)) { - $this->customScriptBuilder[$this->target]['ajax_model'][$view->code] = $this->setCustomContentLang(base64_decode($view->php_ajaxmethod)); + $this->customScriptBuilder[$this->target]['ajax_model'][$view->code] = $this->setDynamicValues(base64_decode($view->php_ajaxmethod)); $this->addSiteAjax = true; } // unset anyway @@ -1424,10 +1519,10 @@ class Get if (ComponentbuilderHelper::checkString($view->php_model)) { $view->php_model = base64_decode($view->php_model); - $view->php_model = $this->setCustomContentLang($view->php_model); + $view->php_model = $this->setDynamicValues($view->php_model); } $view->php_controller = base64_decode($view->php_controller); - $view->php_controller = $this->setCustomContentLang($view->php_controller); + $view->php_controller = $this->setDynamicValues($view->php_controller); // set the button array $buttons = json_decode($view->custom_button,true); unset($view->custom_button); @@ -1461,26 +1556,23 @@ class Get { if (!isset($this->_fieldData[$id]) && $id > 0) { - // Get a db connection. - $db = JFactory::getDbo(); - // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); // Order it by the ordering field. $query->select('a.*'); - $query->select($db->quoteName(array('c.name', 'c.properties'),array('type_name','type_properties'))); + $query->select($this->db->quoteName(array('c.name', 'c.properties'),array('type_name','type_properties'))); $query->from('#__componentbuilder_field AS a'); - $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'c') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('c.id') . ')'); - $query->where($db->quoteName('a.id') . ' = '. $db->quote($id)); + $query->join('LEFT', $this->db->quoteName('#__componentbuilder_fieldtype', 'c') . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' . $this->db->quoteName('c.id') . ')'); + $query->where($this->db->quoteName('a.id') . ' = '. $this->db->quote($id)); // Reset the query using our newly populated query object. - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) { // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $field = $db->loadObject(); + $field = $this->db->loadObject(); // adding a fix for the changed name of type to fieldtype $field->type = $field->fieldtype; @@ -1539,18 +1631,20 @@ class Get } if (!isset($this->_fieldData[$id]->javascript_view_footer_decoded)) { - $this->_fieldData[$id]->javascript_view_footer = $this->setCustomContentLang(base64_decode($this->_fieldData[$id]->javascript_view_footer)); + $this->_fieldData[$id]->javascript_view_footer = $this->setDynamicValues(base64_decode($this->_fieldData[$id]->javascript_view_footer)); $this->_fieldData[$id]->javascript_view_footer_decoded = true; } $this->customScriptBuilder['view_footer'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->javascript_view_footer; - if (strpos($this->_fieldData[$id]->javascript_view_footer,"token") !== false && strpos($this->_fieldData[$id]->javascript_view_footer,"task=ajax") !== false) + if ( strpos($this->_fieldData[$id]->javascript_view_footer,"token") !== false || + strpos($this->_fieldData[$id]->javascript_view_footer,"task=ajax") !== false || + strpos($this->_fieldData[$id]->javascript_view_footer,"[CUSTOM"."CODE=") !== false) // <-- since it could have ajax in it, and we can know for sure at this point { + if(!isset($this->customScriptBuilder['token'])) + { + $this->customScriptBuilder['token'] = array(); + } if (!isset($this->customScriptBuilder['token'][$name_single]) || !$this->customScriptBuilder['token'][$name_single]) { - if(!isset($this->customScriptBuilder['token'])) - { - $this->customScriptBuilder['token'] = array(); - } $this->customScriptBuilder['token'][$name_single] = true; } } @@ -1569,7 +1663,9 @@ class Get } if (!isset($this->_fieldData[$id]->css_view_decoded)) { - $this->_fieldData[$id]->css_view = base64_decode($this->_fieldData[$id]->css_view); + $this->_fieldData[$id]->css_view = base64_decode($this->_fieldData[$id]->css_view); + // check for custom code + $this->setCustomCodeData($this->_fieldData[$id]->css_view); $this->_fieldData[$id]->css_view_decoded = true; } $this->customScriptBuilder['css_view'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->css_view; @@ -1594,13 +1690,19 @@ class Get } if (!isset($this->_fieldData[$id]->javascript_views_footer_decoded)) { - $this->_fieldData[$id]->javascript_views_footer = $this->setCustomContentLang(base64_decode($this->_fieldData[$id]->javascript_views_footer)); + $this->_fieldData[$id]->javascript_views_footer = $this->setDynamicValues(base64_decode($this->_fieldData[$id]->javascript_views_footer)); $this->_fieldData[$id]->javascript_views_footer_decoded = true; } $this->customScriptBuilder['views_footer'][$name_list] .= $this->_fieldData[$id]->javascript_views_footer; - if (strpos($this->_fieldData[$id]->javascript_views_footer,"token") !== false && strpos($this->_fieldData[$id]->javascript_views_footer,"task=ajax") !== false) + if ( strpos($this->_fieldData[$id]->javascript_views_footer,"token") !== false || + strpos($this->_fieldData[$id]->javascript_views_footer,"task=ajax") !== false || + strpos($this->_fieldData[$id]->javascript_views_footer,"[CUSTOM"."CODE=") !== false) // <-- since it could have ajax in it, and we can know for sure at this point { - if (!$this->customScriptBuilder['token'][$name_list]) + if(!isset($this->customScriptBuilder['token'])) + { + $this->customScriptBuilder['token'] = array(); + } + if (!isset($this->customScriptBuilder['token'][$name_list]) || !$this->customScriptBuilder['token'][$name_list]) { $this->customScriptBuilder['token'][$name_list] = true; } @@ -1619,7 +1721,9 @@ class Get } if (!isset($this->_fieldData[$id]->css_views_decoded)) { - $this->_fieldData[$id]->css_views = base64_decode($this->_fieldData[$id]->css_views); + $this->_fieldData[$id]->css_views = base64_decode($this->_fieldData[$id]->css_views); + // check for custom code + $this->setCustomCodeData($this->_fieldData[$id]->css_views); $this->_fieldData[$id]->css_views_decoded = true; } $this->customScriptBuilder['css_views'][$name_list] .= $this->_fieldData[$id]->css_views; @@ -1653,18 +1757,16 @@ class Get $ids = implode(',', $ids); if (ComponentbuilderHelper::checkString($ids)) { - // Get a db connection. - $db = JFactory::getDbo(); // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $query->select('a.*'); $query->from('#__componentbuilder_dynamic_get AS a'); $query->where('a.id IN (' . $ids . ')'); - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) { - $results = $db->loadObjectList(); + $results = $this->db->loadObjectList(); $typeArray = array(1 => 'LEFT', 2 => 'LEFT OUTER', 3 => 'INNER', 4 => 'RIGHT', 5 => 'RIGHT OUTER'); $operatorArray = array(1 => '=', 2 => '!=', 3 => '<>', 4 => '>', 5 => '<', 6 => '>=', 7 => '<=', 8 => '!<', 9 => '!>', 10 => 'IN', 11 => 'NOT IN'); foreach ($results as $nr => &$result) @@ -1681,7 +1783,8 @@ class Get { $this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitem); + $this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] .= + $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitem)); unset($result->php_before_getitem); } // add php custom scripting (php_after_getitem) @@ -1691,7 +1794,8 @@ class Get { $this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitem); + $this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] .= + $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitem)); unset($result->php_after_getitem); } // add php custom scripting (php_before_getitems) @@ -1701,7 +1805,8 @@ class Get { $this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitems); + $this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] .= + $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitems)); unset($result->php_before_getitems); } // add php custom scripting (php_after_getitems) @@ -1711,7 +1816,8 @@ class Get { $this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitems); + $this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] .= + $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitems)); unset($result->php_after_getitems); } // add php custom scripting (php_getlistquery) @@ -1721,7 +1827,8 @@ class Get { $this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] .= PHP_EOL.base64_decode($result->php_getlistquery); + $this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] .= + $this->setDynamicValues(PHP_EOL.base64_decode($result->php_getlistquery)); unset($result->php_getlistquery); } // set the getmethod code name @@ -2066,14 +2173,12 @@ class Get */ public function getDataWithAlias($n_ame,$table,$view) { - // Get a db connection. - $db = JFactory::getDbo(); // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $query->select('a.*'); $query->from('#__componentbuilder_'.$table.' AS a'); - $db->setQuery($query); - $rows = $db->loadObjectList(); + $this->db->setQuery($query); + $rows = $this->db->loadObjectList(); foreach ($rows as $row) { $k_ey = ComponentbuilderHelper::safeString($row->alias); @@ -2084,11 +2189,9 @@ class Get $php_view = ''; if ($row->add_php_view == 1) { - $php_view = base64_decode($row->php_view); - $php_view = $this->setCustomContentLang($php_view); + $php_view = $this->setDynamicValues(base64_decode($row->php_view)); } - $contnent = base64_decode($row->{$table}); - $contnent = $this->setCustomContentLang($contnent); + $contnent = $this->setDynamicValues(base64_decode($row->{$table})); // set uikit to views $this->uikitComp[$view] = ComponentbuilderHelper::getUikitComp($contnent,$this->uikitComp[$view]); // set footable to views and turn it on @@ -2135,49 +2238,48 @@ class Get } /** - * Set Custom Content Language Place Holders + * Set Language Place Holders * * @param string $content The content * * @return string The content with the updated Language place holder * */ - public function setCustomContentLang($content) + public function setLangStrings($content) { - // insure string is not broken - $content = str_replace('COM_###COMPONENT###',$this->langPrefix,$content); - // set language data - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::_('","'"); - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::_("','"'); - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::sprintf('","'"); - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::sprintf("','"'); - $langHolders = array(); - $lang = array(); - foreach ($langCheck as $langChecked) + // first check if we should continue + if (strpos($content, 'JText::_(') !== false || strpos($content, 'JText::sprintf(') !== false) { - if (ComponentbuilderHelper::checkArray($langChecked)) + // insure string is not broken + $content = str_replace('COM_###COMPONENT###',$this->langPrefix,$content); + // set language data + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::_('","'"); + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::_("','"'); + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::sprintf('","'"); + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::sprintf("','"'); + $langArray = ComponentbuilderHelper::mergeArrays($langCheck); + if (ComponentbuilderHelper::checkArray($langArray)) { - $lang = array_merge($lang,$langChecked); - } - } - if (ComponentbuilderHelper::checkArray($lang)) - { - foreach ($lang as $string) - { - // this is there to insure we dont break already added Language strings - if (ComponentbuilderHelper::safeString($string,'U') == $string) + foreach ($langArray as $string) { - continue; + // this is there to insure we dont break already added Language strings + if (ComponentbuilderHelper::safeString($string,'U') === $string) + { + continue; + } + // only load if string is not already set + $keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($string,'U'); + if (!isset($this->langContent[$this->lang][$keyLang])) + { + $this->langContent[$this->lang][$keyLang] = trim($string); + } + $langHolders["JText::_('".$string."')"] = "JText::_('".$keyLang."')"; + $langHolders['JText::_("'.$string.'")'] = 'JText::_("'.$keyLang.'")'; + $langHolders["JText::sprintf('".$string."',"] = "JText::sprintf('".$keyLang."',"; + $langHolders['JText::sprintf("'.$string.'",'] = 'JText::sprintf("'.$keyLang.'",'; } - // only load if string is not already set - $keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($string,'U'); - $this->langContent[$this->lang][$keyLang] = trim($string); - $langHolders["JText::_('".$string."')"] = "JText::_('".$keyLang."')"; - $langHolders['JText::_("'.$string.'")'] = 'JText::_("'.$keyLang.'")'; - $langHolders["JText::sprintf('".$string."',"] = "JText::sprintf('".$keyLang."',"; - $langHolders['JText::sprintf("'.$string.'",'] = 'JText::sprintf("'.$keyLang.'",'; + $content = $this->setPlaceholders($content, $langHolders); } - $content = $this->setPlaceholders($content, $langHolders); } return $content; } @@ -2203,7 +2305,6 @@ class Get $lines = explode(PHP_EOL,$string); if (ComponentbuilderHelper::checkArray($lines)) { - $db = JFactory::getDbo(); if ('db' === $type) { $table = '#__'.$asset; @@ -2242,17 +2343,17 @@ class Get } if (ComponentbuilderHelper::checkString($get)) { - $gets[] = $db->quote($get); + $gets[] = $this->db->quote($get); if (ComponentbuilderHelper::checkString($key)) { $this->getAsLookup[$method_key][$get] = $key; - $keys[] = $db->quote($key); + $keys[] = $this->db->quote($key); } else { $key = str_replace($as.'.','',$get); $this->getAsLookup[$method_key][$get] = $key; - $keys[] = $db->quote($key); + $keys[] = $this->db->quote($key); } if (ComponentbuilderHelper::checkString($view)) { @@ -2264,7 +2365,7 @@ class Get if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys)) { $querySelect = '$query->select($db->quoteName('.PHP_EOL."\t\t\t".'array('.implode(',',$gets).'),'.PHP_EOL."\t\t\t".'array('.implode(',',$keys).')));'; - $queryFrom = '$db->quoteName('.$db->quote($table).', '.$db->quote($as).')'; + $queryFrom = '$db->quoteName('.$this->db->quote($table).', '.$this->db->quote($as).')'; // return the select query return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys); } @@ -2283,15 +2384,13 @@ class Get */ public function getViewTableName($id) { - // Get a db connection. - $db = JFactory::getDbo(); // Create a new query object. - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.name_single'))); - $query->from($db->quoteName('#__componentbuilder_admin_view','a')); - $query->where($db->quoteName('a.id') . ' = '. (int) $id); - $db->setQuery($query); - return ComponentbuilderHelper::safeString($db->loadResult()); + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(array('a.name_single'))); + $query->from($this->db->quoteName('#__componentbuilder_admin_view','a')); + $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); + $this->db->setQuery($query); + return ComponentbuilderHelper::safeString($this->db->loadResult()); } @@ -2311,10 +2410,8 @@ class Get if (ComponentbuilderHelper::checkArray($tables) && (!isset($this->sqlTweak[$view_id]['remove']) || !$this->sqlTweak[$view_id]['remove'])) { $counter = 'a'; - // Get a db connection. - $db = JFactory::getDbo(); // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); foreach ($tables as $table) { if ($counter === 'a') @@ -2340,7 +2437,7 @@ class Get if (ComponentbuilderHelper::checkArray($sourceArray) && ComponentbuilderHelper::checkArray($targetArray)) { // add to query - $query->select($db->quoteName($sourceArray,$targetArray)); + $query->select($this->db->quoteName($sourceArray,$targetArray)); $query->from('#__'.$table['table'].' AS a'); } // we may need to filter the selection @@ -2375,13 +2472,13 @@ class Get { list($aKey,$bKey) = explode("==",$field); // add to query - $query->join('LEFT', $db->quoteName('#__'.$table['table'], $counter) . ' ON (' . $db->quoteName('a.'.trim($aKey)) . ' = ' . $db->quoteName($counter.'.'.trim($bKey)) . ')'); + $query->join('LEFT', $this->db->quoteName('#__'.$table['table'], $counter) . ' ON (' . $this->db->quoteName('a.'.trim($aKey)) . ' = ' . $this->db->quoteName($counter.'.'.trim($bKey)) . ')'); } } if (ComponentbuilderHelper::checkArray($sourceArray) && ComponentbuilderHelper::checkArray($targetArray)) { // add to query - $query->select($db->quoteName($sourceArray,$targetArray)); + $query->select($this->db->quoteName($sourceArray,$targetArray)); } } } @@ -2389,12 +2486,12 @@ class Get $counter++; } // now get the data - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) { // get the data - $data = $db->loadObjectList(); + $data = $this->db->loadObjectList(); // start building the MySql dump $dump = "--"; $dump .= PHP_EOL."-- Dumping data for table `#__[[[component]]]_".$view."`"; @@ -2407,11 +2504,11 @@ class Get { if ($comaSet == 0) { - $dump .= $db->quoteName($fieldName); + $dump .= $this->db->quoteName($fieldName); } else { - $dump .= ", ".$db->quoteName($fieldName); + $dump .= ", ".$this->db->quoteName($fieldName); } $comaSet++; } @@ -2471,9 +2568,7 @@ class Get // if string make sure it is correctly escaped if(ComponentbuilderHelper::checkString($value) && !is_numeric($value)) { - // Get a db connection. - $db = JFactory::getDbo(); - return $db->quote($value); + return $this->db->quote($value); } // if empty value return place holder if(empty($value)) @@ -2588,6 +2683,240 @@ class Get return false; } + /** + * Set the dynamic values in strings here + * + * @param string $string The content to check + * + * @return string + * + */ + public function setDynamicValues($string) + { + return $this->setLangStrings($this->setCustomCodeData($string)); + } + + /** + * We start set the custom code data & can load it in to string + * + * @param string $string The content to check + * @param bool $insert Should we insert the code into the content + * @param bool $bool Should we return bool on success + * + * @return string|bool based on sig + * + */ + public function setCustomCodeData($string) + { + // insure the code is loaded + $loaded = false; + // check if content has custom code place holder + if (strpos($string, '[CUSTO'.'MCODE=') !== false) + { + // the ids found in this content + $bucket = array(); + $found = ComponentbuilderHelper::getAllBetween($string, '[CUSTO'.'MCODE=', ']'); + if (ComponentbuilderHelper::checkArray($found)) + { + foreach ($found as $key) + { + // check if we have args + if (is_numeric($key)) + { + $id = (int) $key; + } + elseif (ComponentbuilderHelper::checkString($key) && strpos($key, '+') === false) + { + $getFuncName = trim($key); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + { + continue; + } + $this->functionNameMemory[$getFuncName] = $found; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + elseif (ComponentbuilderHelper::checkString($key) && strpos($key, '+') !== false) + { + $array = explode('+', $key); + // set ID + if (is_numeric($array[0])) + { + $id = (int) $array[0]; + } + elseif (ComponentbuilderHelper::checkString($array[0])) + { + $getFuncName = trim($array[0]); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + { + continue; + } + $this->functionNameMemory[$getFuncName] = $found; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + else + { + continue; + } + // load args for this ID + if (isset($array[1])) + { + if (!isset($this->customCodeData[$id]['args'])) + { + $this->customCodeData[$id]['args'] = array(); + } + // only load if not already loaded + if (!isset($this->customCodeData[$id]['args'][$key])) + { + if (strpos($array[1], ',') !== false) + { + $this->customCodeData[$id]['args'][$key] = explode(',', $array[1]); + } + elseif (ComponentbuilderHelper::checkString($array[1])) + { + $this->customCodeData[$id]['args'][$key] = array(); + $this->customCodeData[$id]['args'][$key][] = $array[1]; + } + } + } + } + else + { + continue; + } + $bucket[$id] = $id; + } + } + // check if any custom code placeholders where found + if (ComponentbuilderHelper::checkArray($bucket)) + { + $_tmpLang = $this->lang; + // insure we add the langs to both site and admin + $this->lang = 'both'; + // now load the code to memory + $loaded = $this->getCustomCode($bucket, false); + // revert lang to current setting + $this->lang = $_tmpLang; + } + // when the custom code is loaded + if ($loaded === true) + { + $string = $this->insertCustomCode($string); + } + } + return $string; + } + + /** + * Insert the custom code into the string + * + * @param string $string The content to check + * + * @return string on success + * + */ + protected function insertCustomCode($string) + { + $code = array(); + foreach($this->customCode as $item) + { + $this->buildCustomCodePlaceholders($item, $code); + } + // now update the string + return $this->setPlaceholders($string, $code); + } + + /** + * Insert the custom code into the string + * + * @param string $string The content to check + * + * @return string on success + * + */ + protected function buildCustomCodePlaceholders($item, &$code) + { + // check if there is args for this code + if (isset($this->customCodeData[$item['id']]['args']) && ComponentbuilderHelper::checkArray($this->customCodeData[$item['id']]['args'])) + { + // since we have args we cant update this code via IDE (TODO) + $placeholder = $this->getPlaceHolder(3, null); + // we have args and so need to load each + foreach ($this->customCodeData[$item['id']]['args'] as $key => $args) + { + $this->setThesePlaceHolders('arg', $args); + $code['[CUSTOM'.'CODE='.$key.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; + } + // always clear the args + $this->clearFromPlaceHolders('arg'); + } + else + { + if (!$keyPlaceholder = array_search($item['id'], $this->functionNameMemory)) + { + $keyPlaceholder = $item['id']; + } + // check what type of place holders we should load here + $placeholderType = (int) $item['comment_type'].'2'; + if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false) + { + // if view is being set dynamicly then we can't update this code via IDE (TODO) + $placeholderType = 3; + } + // if now ars were found, clear it + $this->clearFromPlaceHolders('arg'); + // load args for this code + $placeholder = $this->getPlaceHolder($placeholderType, $item['id']); + $code['[CUSTOM'.'CODE='.$keyPlaceholder.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; + } + } + + /** + * Set a type of placeholder with set of values + * + * @param string $key The main string for placeholder key + * @param array $values The values to add + * + * @return void + */ + public function setThesePlaceHolders($key, $values) + { + // aways fist reset these + $this->clearFromPlaceHolders($key); + if (ComponentbuilderHelper::checkArray($values)) + { + $number = 0; + foreach ($values as $value) + { + $this->placeholders['[[['.$key.$number.']]]'] = $value; + $number++; + } + } + } + + /** + * Remove a type of placeholder by main string + * + * @param string $like The main string for placeholder key + * + * @return void + */ + public function clearFromPlaceHolders($like) + { + foreach ($this->placeholders as $something => $value) + { + if (stripos($something, $like) !== false) + { + unset($this->placeholders[$something]); + } + } + } + /** * to unset stuff that are private or protected * @@ -2603,36 +2932,51 @@ class Get * @return void * */ - public function getCustomCode($ids = null) + public function getCustomCode($ids = null, $setLang = true) { - // Get a db connection. - $db = JFactory::getDbo(); + // should the result be stored in memory + $loadInMemory = false; // Create a new query object. - $query = $db->getQuery(true); - $query->from($db->quoteName('#__componentbuilder_custom_code','a')); - if ($ids) + $query = $this->db->getQuery(true); + $query->from($this->db->quoteName('#__componentbuilder_custom_code','a')); + if (ComponentbuilderHelper::checkArray($ids)) { - $query->select($db->quoteName(array('a.id','a.code'))); - $query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')'); - $query->where($db->quoteName('a.target') . ' = 2'); // <--- to load the correct target + if ($idArray = $this->customCodeMemory($ids)) + { + $query->select($this->db->quoteName(array('a.id','a.code','a.comment_type'))); + $query->where($this->db->quoteName('a.id') . ' IN (' . implode(',',$idArray) . ')'); + $query->where($this->db->quoteName('a.target') . ' = 2'); // <--- to load the correct target + $loadInMemory = true; + } + else + { + // all values are already in memory continue + return true; + } } else { - $query->select($db->quoteName(array('a.id','a.code','a.component','a.from_line','a.hashtarget','a.hashendtarget','a.path','a.to_line','a.type'))); - $query->where($db->quoteName('a.component') . ' = '. (int) $this->componentData->id); - $query->where($db->quoteName('a.target') . ' = 1'); // <--- to load the correct target - $query->order($db->quoteName('a.from_line') . ' ASC'); // <--- insrue we always add code from top of file + $query->select($this->db->quoteName(array('a.id','a.code','a.comment_type','a.component','a.from_line','a.hashtarget','a.hashendtarget','a.path','a.to_line','a.type'))); + $query->where($this->db->quoteName('a.component') . ' = '. (int) $this->componentData->id); + $query->where($this->db->quoteName('a.target') . ' = 1'); // <--- to load the correct target + $query->order($this->db->quoteName('a.from_line') . ' ASC'); // <--- insrue we always add code from top of file + // reset custom code + $this->customCode = array(); } - $query->where($db->quoteName('a.published') . ' >= 1'); - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) { - $this->customCode = $db->loadAssocList(); + $bucket = $this->db->loadAssocList('id'); // open the code - foreach($this->customCode as $nr => &$customCode) + foreach($bucket as $nr => &$customCode) { $customCode['code'] = base64_decode($customCode['code']); + if ($setLang) + { + $customCode['code'] = $this->setLangStrings($customCode['code']); + } if (isset($customCode['hashtarget'])) { $customCode['hashtarget'] = explode("__", $customCode['hashtarget']); @@ -2642,35 +2986,66 @@ class Get } } } + // load this code into memory if needed + if ($loadInMemory === true) + { + $this->customCodeMemory = $this->customCodeMemory + $bucket; + } + $this->customCode = array_merge($this->customCode, $bucket); return true; } return false; } + /** + * check if we already have these ids in local memory + * + * @return void + * + */ + protected function customCodeMemory($ids) + { + // reset custom code + $this->customCode = array(); + foreach ($ids as $pointer => $id) + { + if (isset($this->customCodeMemory[$id])) + { + $this->customCode[] = $this->customCodeMemory[$id]; + unset($ids[$pointer]); + } + } + // check if any ids left to fetch + if (ComponentbuilderHelper::checkArray($ids)) + { + return $ids; + } + return false; + } + /** * store the code * - * @param object $db The database object * @param int $when To set when to update * * @return void * */ - protected function setNewCustomCode($db, $when = 1) + protected function setNewCustomCode($when = 1) { if (count($this->newCustomCode) >= $when) { // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('path','type','target','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget'); + $columns = array('path','type','target','comment_type','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget'); // Prepare the insert query. - $query->insert($db->quoteName('#__componentbuilder_custom_code')); - $query->columns($db->quoteName($columns)); + $query->insert($this->db->quoteName('#__componentbuilder_custom_code')); + $query->columns($this->db->quoteName($columns)); foreach($this->newCustomCode as $values) { - if (count($values) == 14) + if (count($values) == 15) { $query->values(implode(',', $values)); $continue = true; @@ -2687,33 +3062,32 @@ class Get return false; // insure we dont continue if no values were loaded } // Set the query using our newly populated query object and execute it. - $db->setQuery($query); - $db->execute(); + $this->db->setQuery($query); + $this->db->execute(); } } /** * store the code * - * @param object $db The database object * @param int $when To set when to update * * @return void * */ - protected function setExistingCustomCode($db, $when = 1) + protected function setExistingCustomCode($when = 1) { if (count($this->existingCustomCode) >= $when) { foreach($this->existingCustomCode as $code) { // Create a new query object. - $query = $db->getQuery(true); + $query = $this->db->getQuery(true); // Prepare the update query. - $query->update($db->quoteName('#__componentbuilder_custom_code'))->set($code['fields'])->where($code['conditions']); + $query->update($this->db->quoteName('#__componentbuilder_custom_code'))->set($code['fields'])->where($code['conditions']); // Set the query using our newly populated query object and execute it. - $db->setQuery($query); - $db->execute(); + $this->db->setQuery($query); + $this->db->execute(); } // clear the values array $this->existingCustomCode = array(); @@ -2724,23 +3098,21 @@ class Get * get the custom code from the local files * * @param array $paths The local paths to parse - * @param object $db The database object - * @param int $userId The user id * @param string $today The date for today * * @return void * */ - protected function customCodeFactory(&$paths, &$db, &$userId, &$today) + protected function customCodeFactory(&$paths, &$today) { // we must first store the current woking directory $joomla = getcwd(); $counter = array(1 => 0, 2 => 0); // set some local placeholders $placeholders = array(); - $placeholders[$this->fileContentStatic['###Component###'].'Helper::'] = '[[[Component]]]Helper::'; - $placeholders['com_'.$this->fileContentStatic['###component###']] = 'com_[[[component]]]'; - $placeholders['COM_'.$this->fileContentStatic['###COMPONENT###']] = 'COM_[[[COMPONENT]]]'; + $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F').'Helper::'] = '[[[Component]]]Helper::'; + $placeholders['COM_'.ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]'; + $placeholders['com_'.$this->componentCodeName] = 'com_[[[component]]]'; foreach ($paths as $target => $path) { // we are changing the working directory to the componet path @@ -2749,16 +3121,16 @@ class Get $files = JFolder::files('.', '\.php', true, true); foreach ($files as $file) { - $this->searchFileContent($counter, $file, $target, $this->customCodePlaceholders, $placeholders, $db, $userId, $today); + $this->searchFileContent($counter, $file, $target, $this->customCodePlaceholders, $placeholders, $today); // insert new code if (ComponentbuilderHelper::checkArray($this->newCustomCode)) { - $this->setNewCustomCode($db, 100); + $this->setNewCustomCode(100); } // update existing custom code if (ComponentbuilderHelper::checkArray($this->existingCustomCode)) { - $this->setExistingCustomCode($db, 30); + $this->setExistingCustomCode(30); } } } @@ -2767,12 +3139,12 @@ class Get // make sure all code is stored if (ComponentbuilderHelper::checkArray($this->newCustomCode)) { - $this->setNewCustomCode($db); + $this->setNewCustomCode(); } // update existing custom code if (ComponentbuilderHelper::checkArray($this->existingCustomCode)) { - $this->setExistingCustomCode($db); + $this->setExistingCustomCode(); } } @@ -2783,14 +3155,12 @@ class Get * @param string $file The file path to search * @param array $searchArray The values to search for * @param array $placeholders The values to replace in the code being stored - * @param object $db The database object - * @param int $userId The user id * @param string $today The date for today * * @return array on success * */ - protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$db, &$userId, &$today) + protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$today) { // reset each time per file $loadEndFingerPrint = false; @@ -2800,6 +3170,8 @@ class Get $pointer = array(); $reading = array(); $reader = 0; + // reset found Start type + $commentType = 0; // make sure we have the path correct (the script file is not in admin path for example) // there may be more... will nead to keep our eye on this... since files could be moved during install $file = str_replace('./', '', $file); @@ -2829,9 +3201,18 @@ class Get $targetKey = $type; $start = '/***['.$search.'***/'; $end = '/***[/'.$search.'***/'; + $startHTML = ''; + $endHTML = ''; // check if the ending place holder was found - if(isset($reading[$targetKey]) && $reading[$targetKey] && (trim($lineContent) === $end || strpos($lineContent, $end) !== false)) + if(isset($reading[$targetKey]) && $reading[$targetKey] && + ((trim($lineContent) === $end || strpos($lineContent, $end) !== false) || + (trim($lineContent) === $endHTML || strpos($lineContent, $endHTML) !== false))) { + // trim the placeholder and if there is still data then load it + if ($_line = $this->addLineChecker($endReplace, 2, $lineContent)) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } // deactivate the reader $reading[$targetKey] = false; if ($_type == 2) @@ -2850,23 +3231,28 @@ class Get if ($i === 1) { // end the bucket info for this code block - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $lineNumber); // 'toline' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(base64_encode(implode('', $codeBucket[$pointer[$targetKey]]))); // 'code' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'toline' + // first reverse engineer this code block + $c0de = $this->reversePlaceholders(implode('', $codeBucket[$pointer[$targetKey]]), $placeholders); + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(base64_encode($c0de)); // 'code' if ($_type == 2) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(0); // 'hashendtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(0); // 'hashendtarget' } } // the record already exist so we must use module to update elseif ($i === 2) { - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('to_line') . ' = ' . $db->quote($lineNumber); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('code') . ' = ' . $db->quote(base64_encode(implode('', $codeBucket[$pointer[$targetKey]]))); + // end the bucket info for this code block + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('to_line') . ' = ' . $this->db->quote($lineNumber); + // first reverse engineer this code block + $c0de = $this->reversePlaceholders(implode('', $codeBucket[$pointer[$targetKey]]), $placeholders, $this->existingCustomCode[$pointer[$targetKey]]['id']); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('code') . ' = ' . $this->db->quote(base64_encode($c0de)); if ($_type == 2) { // load the last value - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote(0); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote(0); } } } @@ -2878,12 +3264,12 @@ class Get if ($i === 1) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote($hashendtarget); // 'hashendtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' } // the record already exist so we must use module to update elseif ($i === 2) { - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote($hashendtarget); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote($hashendtarget); } // reset the needed values $endFingerPrint = array(); @@ -2894,16 +3280,35 @@ class Get // then read in the code if (isset($reading[$targetKey]) && $reading[$targetKey]) { - $codeBucket[$pointer[$targetKey]][] = $this->setPlaceholders($lineContent, $placeholders, 2, 2); // <-- this could solve our placholder issue + $codeBucket[$pointer[$targetKey]][] = $lineContent; + } + // see if the custom code line starts now with PHP/JS comment type + if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $start) || strpos($lineContent, $start) !== false)) + { + $commentType = 1; // PHP/JS type + $startReplace = $start; + $endReplace = $end; + } + // see if the custom code line starts now with HTML comment type + elseif ((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $startHTML) || strpos($lineContent, $startHTML) !== false)) + { + $commentType = 2; // HTML type + $startReplace = $startHTML; + $endReplace = $endHTML; } // check if the starting place holder was found - if((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $start) || strpos($lineContent, $start) !== false)) - { + if($commentType > 0) + { + // if we have all on one line we have a problem + if (strpos($lineContent, $endReplace) !== false) + { + continue; + } // do a quick check to insure we have an id $id = false; if ($i === 2) { - $id = $this->getSystemID($lineContent, $start); + $id = $this->getSystemID($lineContent, array(1 => $start, 2 => $startHTML), $commentType); } if ($i === 2 && $id > 0) { @@ -2915,14 +3320,21 @@ class Get // store the id to avoid duplication $this->codeAreadyDone[$id] = (int) $id; } + // start replace + $startReplace = $this->setStartReplace($id, $commentType, $startReplace); // set active reader (to lock out other search) - $reader = $i; + $reader = $i; // set pointer $pointer[$targetKey] = $counter[$i]; // activate the reader $reading[$targetKey] = true; // start code bucket - $codeBucket[$pointer[$targetKey]] = array(); + $codeBucket[$pointer[$targetKey]] = array(); + // trim the placeholder and if there is still data then load it + if ($_line = $this->addLineChecker($startReplace, 1, $lineContent)) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } // get the finger print around the custom code $inFinger = count($fingerPrint); $getFinger = $inFinger - 1; @@ -2934,17 +3346,18 @@ class Get { // start the bucket for this code $this->newCustomCode[$pointer[$targetKey]] = array(); - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote($path); // 'path' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $_type); // 'type' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'target' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $this->componentData->id); // 'component' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'published' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote($today); // 'created' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $userId); // 'created_by' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'version' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'access' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote($hashtarget); // 'hashtarget' - $this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $lineNumber); // 'fromline' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($path); // 'path' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $_type); // 'type' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'target' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($commentType); // 'comment_type' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->componentID); // 'component' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'published' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($today); // 'created' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->user->id); // 'created_by' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'version' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'access' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashtarget); // 'hashtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'fromline' } // the record already exist so we must update instead elseif ($i === 2 && $id > 0) @@ -2953,15 +3366,16 @@ class Get $this->existingCustomCode[$pointer[$targetKey]] = array(); $this->existingCustomCode[$pointer[$targetKey]]['id'] = (int) $id; $this->existingCustomCode[$pointer[$targetKey]]['conditions'] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] = $db->quoteName('id') . ' = ' . $db->quote($id); + $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); $this->existingCustomCode[$pointer[$targetKey]]['fields'] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('path') . ' = ' . $db->quote($path); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('type') . ' = ' . $db->quote($_type); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('component') . ' = ' . $db->quote($this->componentData->id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('from_line') . ' = ' . $db->quote($lineNumber); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('modified') . ' = ' . $db->quote($today); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('modified_by') . ' = ' . $db->quote($userId); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('hashtarget') . ' = ' . $db->quote($hashtarget); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('path') . ' = ' . $this->db->quote($path); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('type') . ' = ' . $this->db->quote($_type); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('comment_type') . ' = ' . $this->db->quote($commentType); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('component') . ' = ' . $this->db->quote($this->componentID); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('from_line') . ' = ' . $this->db->quote($lineNumber); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote($this->user->id); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashtarget') . ' = ' . $this->db->quote($hashtarget); } else // this should actualy never happen { @@ -2970,6 +3384,8 @@ class Get $reader = 0; } + // reset found comment type + $commentType = 0; // update the counter $counter[$i]++; } @@ -2997,16 +3413,78 @@ class Get if ($backupI === 1) { // load the last value - $this->newCustomCode[$pointer[$backupTargetKey]][] = $db->quote($hashendtarget); // 'hashendtarget' + $this->newCustomCode[$pointer[$backupTargetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' } // the record already exist so we must use module to update elseif ($backupI === 2) { - $this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote($hashendtarget); + $this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote($hashendtarget); } } } + /** + * Check if this line should be added + * + * @param strin $replaceKey The key to remove from line + * @param int $type The line type + * @param string $lineContent The line to check + * + * @return bool true on success + * + */ + protected function addLineChecker($replaceKey, $type, $lineContent) + { + $check = explode($replaceKey, $lineContent); + switch($type) + { + case 1: + // beginning of code + $i = trim($check[1]); + if (ComponentbuilderHelper::checkString($i)) + { + return $check[1]; + } + break; + case 2: + // end of code + $i = trim($check[0]); + if (ComponentbuilderHelper::checkString($i)) + { + return $check[0]; + } + break; + } + return false; + } + + /** + * search for the system id in the line given + * + * @param int $id The comment id + * @param int $commentType The comment type + * @param string $startReplace The main replace string + * + * @return array on success + * + */ + protected function setStartReplace($id, $commentType, $startReplace) + { + if ($id > 0) + { + switch($commentType) + { + case 1: + $startReplace .= '/*'.$id.'*/'; + break; + case 2: + $startReplace .= ''; + break; + } + } + return $startReplace; + } + /** * search for the system id in the line given * @@ -3016,10 +3494,15 @@ class Get * @return array on success * */ - protected function getSystemID(&$lineContent, $placeholder) + protected function getSystemID(&$lineContent, $placeholders, $commentType) { + $trim = '/'; + if ($commentType == 2) + { + $trim = ' + if ($this->addPlaceholders === true) + { + return array( + 'start' => '', + 'end' => ''); + } + else + { + return array( + 'start' => "\t\t\t", + 'end' => "\t\t\t"); + } + break; + case 22: + // + if ($this->addPlaceholders === true) + { + return array( + 'start' => '', + 'end' => ''); + } + else + { + return array( + 'start' => "\t\t\t", + 'end' => "\t\t\t"); + } + break; case 3: return array( 'start' => "\t\t\t", @@ -3163,4 +3732,35 @@ class Get } return false; } + + /** + * get the local installed path of this component + * + * @return array of paths on success + * + */ + protected function getLocalInstallPaths() + { + // set the local paths to search + $localPaths = array(); + // admin path + $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'. $this->componentCodeName; + // site path + $localPaths['site'] = JPATH_ROOT . '/components/com_'. $this->componentCodeName; + // TODO later to include the JS and CSS + $localPaths['media'] = JPATH_ROOT . '/media/com_'. $this->componentCodeName; + // check if the local install is found + foreach ($localPaths as $key => $localPath) + { + if (!JFolder::exists($localPath)) + { + unset($localPaths[$key]); + } + } + if (ComponentbuilderHelper::checkArray($localPaths)) + { + return $localPaths; + } + return false; + } } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 67ebb68bb..d4f321f77 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -969,38 +969,4 @@ class Structure extends Get } return false; } - - /** - * get the local installed path of this component - * - * @return array of paths on success - * - */ - public function getLocalInstallPaths() - { - // set the local paths to search - $localPaths = array(); - // the admin path - $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'. $this->componentCodeName; - // only check for site path if the component has a site area! - if (!$this->removeSiteFolder) - { - $localPaths['site'] = JPATH_ROOT . '/components/com_'. $this->componentCodeName; - } - // TODO later to include the JS and CSS - // $localPaths['media'] = JPATH_ROOT . '/media/com_'. $this->fileContentStatic['###component###']; - // check if the local install is found - foreach ($localPaths as $key => $localPath) - { - if (!JFolder::exists($localPath)) - { - unset($localPaths[$key]); - } - } - if (ComponentbuilderHelper::checkArray($localPaths)) - { - return $localPaths; - } - return false; - } } diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index e6f3e601f..29c336727 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -31,15 +31,7 @@ defined('_JEXEC') or die('Restricted access'); */ class Interpretation extends Fields { - /* - * The line numbers Switch - * - * @var boolean - */ - public $loadLineNr = false; - public $theContributors = ''; - public $placeholders = array(); public $uninstallBuilder = array(); public $listColnrBuilder = array(); public $permissionBuilder = array(); @@ -65,8 +57,6 @@ class Interpretation extends Fields // first we run the perent constructor if (parent::__construct($config)) { - // set if line numbers should be added to comments - $this->loadLineNr = ($this->componentData->debug_linenr) ? true:false; return true; } return false; @@ -4780,7 +4770,7 @@ class Interpretation extends Fields { $db .= PHP_EOL."\t`id` INT(11) NOT NULL AUTO_INCREMENT,"; } - $db .= PHP_EOL."\t`asset_id` INT(255) UNSIGNED NOT NULL DEFAULT '0',"; + $db .= PHP_EOL."\t`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; ksort($fields); foreach ($fields as $field => $data) { @@ -4826,22 +4816,22 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['params'])) { - $db .= PHP_EOL."\t`params` TEXT NOT NULL,"; + $db .= PHP_EOL."\t`params` text NOT NULL DEFAULT '',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['published'])) { - $db .= PHP_EOL."\t`published` TINYINT(1) NOT NULL DEFAULT '1',"; + $db .= PHP_EOL."\t`published` TINYINT(3) NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created_by'])) { - $db .= PHP_EOL."\t`created_by` INT(11) NOT NULL DEFAULT '0',"; + $db .= PHP_EOL."\t`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db .= PHP_EOL."\t`modified_by` INT(11) NOT NULL DEFAULT '0',"; + $db .= PHP_EOL."\t`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created'])) @@ -4856,7 +4846,7 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL,"; + $db .= PHP_EOL."\t`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out_time'])) @@ -4866,22 +4856,22 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['version'])) { - $db .= PHP_EOL."\t`version` INT(11) NOT NULL DEFAULT '1',"; + $db .= PHP_EOL."\t`version` INT(10) unsigned NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['hits'])) { - $db .= PHP_EOL."\t`hits` INT(11) NOT NULL DEFAULT '0',"; + $db .= PHP_EOL."\t`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if view has access if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $db .= PHP_EOL."\t`access` INT(11) DEFAULT NULL,"; + $db .= PHP_EOL."\t`access` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['ordering'])) { - $db .= PHP_EOL."\t`ordering` INT(11) NOT NULL DEFAULT '0',"; + $db .= PHP_EOL."\t`ordering` INT(11) NOT NULL DEFAULT 0,"; } // check if metadata is added to this view if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view])) diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 53a2f55e1..8382667a7 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -34,6 +34,7 @@ class Infusion extends Interpretation public $eximportView = array(); public $importCustomScripts = array(); + public $langFiles = array(); public $removeSiteFolder = false; /** @@ -1019,18 +1020,6 @@ class Infusion extends Interpretation // clear all site folder since none is needed $this->removeSiteFolder = true; } - - // ###LANG_ADMIN### - $this->fileContentStatic['###LANG_ADMIN###'] = $this->setLangAdmin(); - - // ###LANG_ADMIN_SYS### - $this->fileContentStatic['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys(); - - // ###LANG_SITE### - $this->fileContentStatic['###LANG_SITE###'] = $this->setLangSite(); - - // ###LANG_SITE_SYS### - $this->fileContentStatic['###LANG_SITE_SYS###'] = $this->setLangSiteSys(); // ###PREINSTALLSCRIPT### $this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true); @@ -1072,5 +1061,41 @@ class Infusion extends Interpretation } return false; } + + /** + * Build the lang values and insert to fiel + * + * + * @return boolean on success + * + */ + + public function setLangFileData() + { + // First we build the strings + $lang = array(); + // ###LANG_ADMIN### + $lang['###LANG_ADMIN###'] = $this->setLangAdmin(); + // ###LANG_ADMIN_SYS### + $lang['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys(); + // ###LANG_SITE### + $lang['###LANG_SITE###'] = $this->setLangSite(); + // ###LANG_SITE_SYS### + $lang['###LANG_SITE_SYS###'] = $this->setLangSiteSys(); + // now we insert the values into the files + if (ComponentbuilderHelper::checkArray($this->langFiles)) + { + foreach ($this->langFiles as $file) + { + $string = JFile::read($file['path']); + // load the data + $answer = $this->setPlaceholders($string, $lang, 3); + // add to zip array + $this->writeFile($file['path'],$answer); + // set the line counter + $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + } + } + } } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 552fee6df..70412abbf 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php @@ -1332,55 +1332,67 @@ abstract class ComponentbuilderHelper public static function safeString($string, $type = 'L', $spacer = '_') { - // remove all numbers and replace with english text version (works well only up to a thousand) + // remove all numbers and replace with english text version (works well only up to millions) $string = self::replaceNumbers($string); - + // 0nly continue if we have a string if (self::checkString($string)) { - // remove all other characters - $string = trim($string); - $string = preg_replace('/'.$spacer.'+/', ' ', $string); - $string = preg_replace('/\s+/', ' ', $string); - $string = preg_replace("/[^A-Za-z ]/", '', $string); - // return a string with all first letter of each word uppercase(no undersocre) - if ($type == 'W') - { - return ucwords(strtolower($string)); - } - elseif ($type == 'w') - { - return strtolower($string); - } - elseif ($type == 'Ww') - { - return ucfirst(strtolower($string)); - } - elseif ($type == 'WW') - { - return strtoupper($string); - } - elseif ($type == 'U') - { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return all upper - return strtoupper($string); - } - elseif ($type == 'F') - { - // replace white space with underscore - $string = preg_replace('/\s+/', $spacer, $string); - // return with first caracter to upper - return ucfirst(strtolower($string)); - } - elseif ($type == 'L') + // remove all other characters + $string = trim($string); + $string = preg_replace('/'.$spacer.'+/', ' ', $string); + $string = preg_replace('/\s+/', ' ', $string); + $string = preg_replace("/[^A-Za-z ]/", '', $string); + // select final adaptations + if ($type === 'L' || $type === 'strtolower') { // replace white space with underscore $string = preg_replace('/\s+/', $spacer, $string); // default is to return lower return strtolower($string); } - + elseif ($type === 'W') + { + // return a string with all first letter of each word uppercase(no undersocre) + return ucwords(strtolower($string)); + } + elseif ($type === 'w' || $type === 'word') + { + // return a string with all lowercase(no undersocre) + return strtolower($string); + } + elseif ($type === 'Ww' || $type === 'Word') + { + // return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre) + return ucfirst(strtolower($string)); + } + elseif ($type === 'WW' || $type === 'WORD') + { + // return a string with all the uppercase(no undersocre) + return strtoupper($string); + } + elseif ($type === 'U' || $type === 'strtoupper') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return all upper + return strtoupper($string); + } + elseif ($type === 'F' || $type === 'ucfirst') + { + // replace white space with underscore + $string = preg_replace('/\s+/', $spacer, $string); + // return with first caracter to upper + return ucfirst(strtolower($string)); + } + elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') + { + // convert all words to first letter uppercase + $string = ucwords(strtolower($string)); + // remove white space + $string = preg_replace('/\s+/', '', $string); + // now return first letter lowercase + return lcfirst($string); + } // return string return $string; } diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index 042bd9dd3..c31f931e2 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index 610c6eaf9..d400f216c 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage batch_.php diff --git a/admin/helpers/indenter.php b/admin/helpers/indenter.php index 8fda93684..ea66e7372 100644 --- a/admin/helpers/indenter.php +++ b/admin/helpers/indenter.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage indenter.php diff --git a/admin/helpers/js.php b/admin/helpers/js.php index e0f755934..d9a810474 100644 --- a/admin/helpers/js.php +++ b/admin/helpers/js.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage js.php diff --git a/admin/helpers/minify.php b/admin/helpers/minify.php index 9aae15d37..8b0d3e00c 100644 --- a/admin/helpers/minify.php +++ b/admin/helpers/minify.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage minify.php diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index f03527608..b1990d4b6 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1,4 +1,8 @@ COM_COMPONENTBUILDER="Component Builder" +COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB="Add corresponding line numbers to the dynamic comments, so to see where in the compiler the lines of code was build. This will help if you need to get more technical with an issue on github." +COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders" +COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_LTSMALLGTIF_SETLTSMALLGT="Add to Backup Folder & Sales Server <small>(if set)</small>" +COM_COMPONENTBUILDER_ADD_TO_GIT_FOLDER="Add to Git Folder" COM_COMPONENTBUILDER_ADMIN_VIEW="Admin View" COM_COMPONENTBUILDER_ADMIN_VIEWS="Admin Views" COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS="Admin Views Access" @@ -923,7 +927,7 @@ COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_TAB_LABEL="Dashboard Tabs" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_TAB_SELECT="Add" COM_COMPONENTBUILDER_COMPONENT_DATABASE="Database" COM_COMPONENTBUILDER_COMPONENT_DEBUG_LINENR="Debug Linenr" -COM_COMPONENTBUILDER_COMPONENT_DEBUG_LINENR_DESCRIPTION="Add corresponding line numbers, so to see where in the compiler the line of code was build." +COM_COMPONENTBUILDER_COMPONENT_DEBUG_LINENR_DESCRIPTION="Add corresponding line numbers to the dynamic comments, so to see where in the compiler the lines of code was build. This will help if you need to get more technical with an issue on github." COM_COMPONENTBUILDER_COMPONENT_DEBUG_LINENR_LABEL="Debug (line numbers)" COM_COMPONENTBUILDER_COMPONENT_DEFAULT_VIEW_DESCRIPTION="Select only one." COM_COMPONENTBUILDER_COMPONENT_DEFAULT_VIEW_LABEL="Default View" @@ -1907,6 +1911,9 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_CODE="Code" COM_COMPONENTBUILDER_CUSTOM_CODE_CODE_DESCRIPTION="Add your PHP here! [Do not add the php tags]" COM_COMPONENTBUILDER_CUSTOM_CODE_CODE_HINT="// Custom PHP that will be added to the file." COM_COMPONENTBUILDER_CUSTOM_CODE_CODE_LABEL="Custom code" +COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE="Comment Type" +COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_DESCRIPTION="Select what type of comment is used to mark the placement of this code." +COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL="Comment Type (used in placeholder)" COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT="Component" COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL="Component" COM_COMPONENTBUILDER_CUSTOM_CODE_CREATED_BY_DESC="The user that created this Custom Code." @@ -1920,6 +1927,9 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE="From Line" COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_DESCRIPTION="The line from where to start adding the code." COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_HINT="Only Numbers" COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_LABEL="From Line (Zero based)" +COM_COMPONENTBUILDER_CUSTOM_CODE_FUNCTION_NAME="Function Name" +COM_COMPONENTBUILDER_CUSTOM_CODE_FUNCTION_NAME_DESCRIPTION="The name for this code snippet" +COM_COMPONENTBUILDER_CUSTOM_CODE_FUNCTION_NAME_LABEL="Function Name" COM_COMPONENTBUILDER_CUSTOM_CODE_HASHENDTARGET="Hashendtarget" COM_COMPONENTBUILDER_CUSTOM_CODE_HASHENDTARGET_DESCRIPTION="The end hash target to help insert the code until the correct place, if the line position change. This hash is the md5 of a few lines below the custom code" COM_COMPONENTBUILDER_CUSTOM_CODE_HASHENDTARGET_HINT="autogenerated md5 hash" @@ -1929,6 +1939,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_HASHTARGET_DESCRIPTION="The start hash target t COM_COMPONENTBUILDER_CUSTOM_CODE_HASHTARGET_HINT="autogenerated md5 hash" COM_COMPONENTBUILDER_CUSTOM_CODE_HASHTARGET_LABEL="Start Hash Target" COM_COMPONENTBUILDER_CUSTOM_CODE_HASH_AUTOMATION="Hash (automation)" +COM_COMPONENTBUILDER_CUSTOM_CODE_HTML="HTML" COM_COMPONENTBUILDER_CUSTOM_CODE_ID="Id" COM_COMPONENTBUILDER_CUSTOM_CODE_INSERTION="Insertion" COM_COMPONENTBUILDER_CUSTOM_CODE_JCB_MANUAL="JCB (manual)" @@ -1939,6 +1950,26 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_DATE_LABEL="Modified Date" COM_COMPONENTBUILDER_CUSTOM_CODE_NEW="A New Custom Code" COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_JCB_PLACEHOLDER_DESCRIPTION="[save to see placeholder]
You can also pass values to this code like this: [save to see placeholder trick]
Those values will be replace placeholders called args. These placeholders are zero based and should look like this: [[[arg0]]], [[[arge1]]] ... as many as you like. If you use 5 args in your code, you must always pass 5 values, since they are zero based your fifth arg will look like this [[[arg4]]]
Please note that you can not use this placeholder in other custom code views, but in all other custom code areas in JCB found in other views like the admin, site and custom admin views.
Another important note, all code with args will not be reversed updated from the changes in the editor out side of JCB at this time, since that will remove all the arg placeholders this means you will only be able to update the code here in the JCB UI.
This note will change once we have resolved these limitations." COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_JCB_PLACEHOLDER_LABEL="You can use this code in any JCB code area, simply add this PlaceHolder." +COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="

Understand how the placeholders work

Comment Type PHP/JS

+

New Insert Code = /***[INSERT<>$$$$]***/ <YOUR CODE HERE> /***[/INSERT<>$$$$]***/ +
New Replace Codec= /***[REPLACE<>$$$$]***/ <YOUR CODE HERE> /***[/REPLACE<>$$$$]***/

+

When JCB adds it back

+

JCB Add Inserted Code = /***[INSERTED$$$$]***//*x*/ <YOUR CODE HERE> /***[/INSERTED$$$$]***/ +
JCB Add Replaced Code = /***[REPLACED$$$$]***//*x*/ <YOUR CODE HERE> /***[/REPLACED$$$$]***/

+

To changing existing custom code

+

Update Inserted Code = /***[INSERTED<>$$$$]***//*x*/ <YOUR CODE HERE> /***[/INSERTED<>$$$$]***/ +
Update Replaced Code = /***[REPLACED<>$$$$]***//*x*/ <YOUR CODE HERE> /***[/REPLACED<>$$$$]***/

+

Comment Type HTML

+

New Insert Code = <!--[INSERT<>$$$$]--> <YOUR CODE HERE> <!--[/INSERT<>$$$$]--> +
New Replace Code = <!--[REPLACE<>$$$$]--> <YOUR CODE HERE> <!--[/REPLACE<>$$$$]-->

+

When JCB adds it back

+

JCB Add Inserted Code = <!--[INSERTED$$$$]--><!--x--> <YOUR CODE HERE> <!--[/INSERTED$$$$]--> +
JCB Add Replaced Code = <!--[REPLACED$$$$]--><!--x--> <YOUR CODE HERE> <!--[/REPLACED$$$$]-->

+

To changing existing custom code

+

Update Inserted Code = <!--[INSERTED<>$$$$]--><!--x--> <YOUR CODE HERE> <!--[/INSERTED<>$$$$]--> +
Update Replaced Code = <!--[REPLACED<>$$$$]--><!--x--> <YOUR CODE HERE> <!--[/REPLACED<>$$$$]-->

+

x is the ID of the code in the system don't change it when you edit the code in your IDE outside of JCB!

" +COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_LABEL="Information Area." COM_COMPONENTBUILDER_CUSTOM_CODE_NOT_REQUIRED="Not Required" COM_COMPONENTBUILDER_CUSTOM_CODE_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_CUSTOM_CODE_PATH="Path" @@ -1946,6 +1977,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_DESCRIPTION="File path of where this code COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_HINT="File Path Here" COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL="File Path" COM_COMPONENTBUILDER_CUSTOM_CODE_PERMISSION="Permissions" +COM_COMPONENTBUILDER_CUSTOM_CODE_PHPJS="PHP/JS" COM_COMPONENTBUILDER_CUSTOM_CODE_PUBLISHING="Publishing" COM_COMPONENTBUILDER_CUSTOM_CODE_REPLACEMENT="Replacement" COM_COMPONENTBUILDER_CUSTOM_CODE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Custom Code to customise the alias." @@ -1995,6 +2027,7 @@ COM_COMPONENTBUILDER_DASHBOARD_SNIPPET_ADD="Add Snippet

" COM_COMPONENTBUILDER_DASHBOARD_TEMPLATES="Templates

" COM_COMPONENTBUILDER_DASHBOARD_TEMPLATE_ADD="Add Template

" COM_COMPONENTBUILDER_DATE="Date" +COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS="Debug (line numbers)" COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get" COM_COMPONENTBUILDER_DYNAMIC_GETS="Dynamic Gets" COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS="Dynamic Gets Access" @@ -2595,6 +2628,8 @@ COM_COMPONENTBUILDER_FIELD_XML_HINT="Field XML Go Here" COM_COMPONENTBUILDER_FIELD_XML_LABEL="XML field definition (Please set the field details here to fit your needs)" COM_COMPONENTBUILDER_FIELD_YES="Yes" COM_COMPONENTBUILDER_FIELD_ZERO="0" +COM_COMPONENTBUILDER_GLOBAL="Global" +COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!" COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document" COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access" @@ -2860,6 +2895,7 @@ COM_COMPONENTBUILDER_LAYOUT_YES="Yes" COM_COMPONENTBUILDER_LICENSE="License" COM_COMPONENTBUILDER_NEW="New" COM_COMPONENTBUILDER_NEW_ISSUE="New Issue" +COM_COMPONENTBUILDER_NO="No" COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!" COM_COMPONENTBUILDER_OPENED_BY="opened by" COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER="Please check again latter." @@ -2867,6 +2903,10 @@ COM_COMPONENTBUILDER_RESPOND_TO_THIS_ISSUE_ON_GITHUB="Respond to this issue on G COM_COMPONENTBUILDER_REVIEW_THIS_ISSUE_ON_GITHUB="Review this issue on Github" COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved." COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another." +COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile" +COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." +COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_GIT_FOLDER="Should the component be moved to your local git folder?" +COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET="Should the zipped package of the component be moved to the local backup and remote sales server? This is only applicable if this component has those values set." COM_COMPONENTBUILDER_SITE_VIEW="Site View" COM_COMPONENTBUILDER_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_SITE_VIEWS_ACCESS="Site Views Access" @@ -3399,6 +3439,7 @@ COM_COMPONENTBUILDER_SNIPPET_USAGE_HINT="Add Usage Here" COM_COMPONENTBUILDER_SNIPPET_USAGE_LABEL="Usage" COM_COMPONENTBUILDER_SNIPPET_VERSION_DESC="A count of the number of times this Snippet has been revised." COM_COMPONENTBUILDER_SNIPPET_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_SORRY_THIS_FUNCTION_NAME_IS_ALREADY_IN_USE="Sorry this function name is already in use!" COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS="Admin Views" COM_COMPONENTBUILDER_SUBMENU_COMPILER="Compiler" COM_COMPONENTBUILDER_SUBMENU_COMPONENTS="Components" @@ -3524,3 +3565,5 @@ COM_COMPONENTBUILDER_USE_BATCH_DESC=" Allows users in this group to use batch co COM_COMPONENTBUILDER_VERSION="Version" COM_COMPONENTBUILDER_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github" COM_COMPONENTBUILDER_WEBSITE="Website" +COM_COMPONENTBUILDER_YES="Yes" +COM_COMPONENTBUILDER__SELECT_COMPONENT_="- Select Component -" diff --git a/admin/layouts/admin_view/css_fullwidth.php b/admin/layouts/admin_view/css_fullwidth.php index be1f1c500..47a2093af 100644 --- a/admin/layouts/admin_view/css_fullwidth.php +++ b/admin/layouts/admin_view/css_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage css_fullwidth.php diff --git a/admin/layouts/admin_view/custom_buttons_fullwidth.php b/admin/layouts/admin_view/custom_buttons_fullwidth.php index aac1f358b..bf3444419 100644 --- a/admin/layouts/admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/admin_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/admin_view/custom_buttons_left.php b/admin/layouts/admin_view/custom_buttons_left.php index 532511290..eabcb120c 100644 --- a/admin/layouts/admin_view/custom_buttons_left.php +++ b/admin/layouts/admin_view/custom_buttons_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_left.php diff --git a/admin/layouts/admin_view/custom_import_fullwidth.php b/admin/layouts/admin_view/custom_import_fullwidth.php index 4e97d5062..2784763a4 100644 --- a/admin/layouts/admin_view/custom_import_fullwidth.php +++ b/admin/layouts/admin_view/custom_import_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_import_fullwidth.php diff --git a/admin/layouts/admin_view/fields_fullwidth.php b/admin/layouts/admin_view/fields_fullwidth.php index 6d16b0816..b971d4da0 100644 --- a/admin/layouts/admin_view/fields_fullwidth.php +++ b/admin/layouts/admin_view/fields_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields_fullwidth.php diff --git a/admin/layouts/admin_view/javascript_fullwidth.php b/admin/layouts/admin_view/javascript_fullwidth.php index baa085fa9..c086c3525 100644 --- a/admin/layouts/admin_view/javascript_fullwidth.php +++ b/admin/layouts/admin_view/javascript_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage javascript_fullwidth.php diff --git a/admin/layouts/admin_view/linked_components_fullwidth.php b/admin/layouts/admin_view/linked_components_fullwidth.php index 04f7401b9..a3da32860 100644 --- a/admin/layouts/admin_view/linked_components_fullwidth.php +++ b/admin/layouts/admin_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php diff --git a/admin/layouts/admin_view/mysql_fullwidth.php b/admin/layouts/admin_view/mysql_fullwidth.php index 29c51788e..bf2cd8353 100644 --- a/admin/layouts/admin_view/mysql_fullwidth.php +++ b/admin/layouts/admin_view/mysql_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_fullwidth.php diff --git a/admin/layouts/admin_view/mysql_left.php b/admin/layouts/admin_view/mysql_left.php index 8490c18d2..055f87b5c 100644 --- a/admin/layouts/admin_view/mysql_left.php +++ b/admin/layouts/admin_view/mysql_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_left.php diff --git a/admin/layouts/admin_view/php_fullwidth.php b/admin/layouts/admin_view/php_fullwidth.php index 9a4b98197..9fabd22c5 100644 --- a/admin/layouts/admin_view/php_fullwidth.php +++ b/admin/layouts/admin_view/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/admin_view/publishing.php +++ b/admin/layouts/admin_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/admin_view/publlshing.php b/admin/layouts/admin_view/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/admin_view/publlshing.php +++ b/admin/layouts/admin_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/admin_view/settings_above.php b/admin/layouts/admin_view/settings_above.php index 63614c186..4c98f6c3c 100644 --- a/admin/layouts/admin_view/settings_above.php +++ b/admin/layouts/admin_view/settings_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_above.php diff --git a/admin/layouts/admin_view/settings_left.php b/admin/layouts/admin_view/settings_left.php index b2cb2bcc0..105e4ce32 100644 --- a/admin/layouts/admin_view/settings_left.php +++ b/admin/layouts/admin_view/settings_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_left.php diff --git a/admin/layouts/admin_view/settings_right.php b/admin/layouts/admin_view/settings_right.php index 238e122cd..d06d17528 100644 --- a/admin/layouts/admin_view/settings_right.php +++ b/admin/layouts/admin_view/settings_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_right.php diff --git a/admin/layouts/admin_view/settings_under.php b/admin/layouts/admin_view/settings_under.php index 5972ea722..7f1f8b441 100644 --- a/admin/layouts/admin_view/settings_under.php +++ b/admin/layouts/admin_view/settings_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_under.php diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 877898de9..1d958cca7 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage batchselection.php diff --git a/admin/layouts/component/admin_views_fullwidth.php b/admin/layouts/component/admin_views_fullwidth.php index f24f7c56b..030a215fd 100644 --- a/admin/layouts/component/admin_views_fullwidth.php +++ b/admin/layouts/component/admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_views_fullwidth.php diff --git a/admin/layouts/component/custom_admin_views_fullwidth.php b/admin/layouts/component/custom_admin_views_fullwidth.php index 1feb33dff..6ea5498bd 100644 --- a/admin/layouts/component/custom_admin_views_fullwidth.php +++ b/admin/layouts/component/custom_admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_admin_views_fullwidth.php diff --git a/admin/layouts/component/details_above.php b/admin/layouts/component/details_above.php index 052859caa..dd354e033 100644 --- a/admin/layouts/component/details_above.php +++ b/admin/layouts/component/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/component/details_left.php b/admin/layouts/component/details_left.php index d599aeb4c..827b1b4cd 100644 --- a/admin/layouts/component/details_left.php +++ b/admin/layouts/component/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/component/details_right.php b/admin/layouts/component/details_right.php index 86d57cf64..c93c8d05e 100644 --- a/admin/layouts/component/details_right.php +++ b/admin/layouts/component/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/component/details_under.php b/admin/layouts/component/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/component/details_under.php +++ b/admin/layouts/component/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/component/dynamic_build_beta_fullwidth.php b/admin/layouts/component/dynamic_build_beta_fullwidth.php index 72e9b7914..ab02dbdf5 100644 --- a/admin/layouts/component/dynamic_build_beta_fullwidth.php +++ b/admin/layouts/component/dynamic_build_beta_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamic_build_beta_fullwidth.php diff --git a/admin/layouts/component/dynamic_integration_fullwidth.php b/admin/layouts/component/dynamic_integration_fullwidth.php index 306f921cc..0525f432a 100644 --- a/admin/layouts/component/dynamic_integration_fullwidth.php +++ b/admin/layouts/component/dynamic_integration_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamic_integration_fullwidth.php diff --git a/admin/layouts/component/libs_helpers_fullwidth.php b/admin/layouts/component/libs_helpers_fullwidth.php index a211a3ec9..9579075d1 100644 --- a/admin/layouts/component/libs_helpers_fullwidth.php +++ b/admin/layouts/component/libs_helpers_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage libs_helpers_fullwidth.php diff --git a/admin/layouts/component/mysql_fullwidth.php b/admin/layouts/component/mysql_fullwidth.php index 005a177b3..0dd41c522 100644 --- a/admin/layouts/component/mysql_fullwidth.php +++ b/admin/layouts/component/mysql_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_fullwidth.php diff --git a/admin/layouts/component/php_fullwidth.php b/admin/layouts/component/php_fullwidth.php index a7a83cd7f..f1f3daae4 100644 --- a/admin/layouts/component/php_fullwidth.php +++ b/admin/layouts/component/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/component/publishing.php b/admin/layouts/component/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/component/publishing.php +++ b/admin/layouts/component/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/component/publlshing.php b/admin/layouts/component/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/component/publlshing.php +++ b/admin/layouts/component/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/component/readme_left.php b/admin/layouts/component/readme_left.php index aafa399ee..e75b2f798 100644 --- a/admin/layouts/component/readme_left.php +++ b/admin/layouts/component/readme_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage readme_left.php diff --git a/admin/layouts/component/readme_right.php b/admin/layouts/component/readme_right.php index 9bd5a666c..7c8db6411 100644 --- a/admin/layouts/component/readme_right.php +++ b/admin/layouts/component/readme_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage readme_right.php diff --git a/admin/layouts/component/settings_left.php b/admin/layouts/component/settings_left.php index d4a951650..e0e13cb4f 100644 --- a/admin/layouts/component/settings_left.php +++ b/admin/layouts/component/settings_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_left.php diff --git a/admin/layouts/component/settings_right.php b/admin/layouts/component/settings_right.php index ecd35312e..e752513f2 100644 --- a/admin/layouts/component/settings_right.php +++ b/admin/layouts/component/settings_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_right.php diff --git a/admin/layouts/component/site_views_fullwidth.php b/admin/layouts/component/site_views_fullwidth.php index 45fb6c72f..be2d96a3b 100644 --- a/admin/layouts/component/site_views_fullwidth.php +++ b/admin/layouts/component/site_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage site_views_fullwidth.php diff --git a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php index aac1f358b..bf3444419 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/custom_admin_view/custom_buttons_left.php b/admin/layouts/custom_admin_view/custom_buttons_left.php index 532511290..eabcb120c 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_left.php +++ b/admin/layouts/custom_admin_view/custom_buttons_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_left.php diff --git a/admin/layouts/custom_admin_view/custom_script_fullwidth.php b/admin/layouts/custom_admin_view/custom_script_fullwidth.php index e3b094ff3..0d575298a 100644 --- a/admin/layouts/custom_admin_view/custom_script_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/custom_admin_view/details_above.php b/admin/layouts/custom_admin_view/details_above.php index 052859caa..dd354e033 100644 --- a/admin/layouts/custom_admin_view/details_above.php +++ b/admin/layouts/custom_admin_view/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/custom_admin_view/details_fullwidth.php b/admin/layouts/custom_admin_view/details_fullwidth.php index 7820e5dc2..a635da226 100644 --- a/admin/layouts/custom_admin_view/details_fullwidth.php +++ b/admin/layouts/custom_admin_view/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php index c43bad7b7..e25e73395 100644 --- a/admin/layouts/custom_admin_view/details_left.php +++ b/admin/layouts/custom_admin_view/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/custom_admin_view/details_right.php b/admin/layouts/custom_admin_view/details_right.php index b4a5c094d..bddd0aed4 100644 --- a/admin/layouts/custom_admin_view/details_right.php +++ b/admin/layouts/custom_admin_view/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/custom_admin_view/details_rightside.php b/admin/layouts/custom_admin_view/details_rightside.php index b565f0f05..f35c06463 100644 --- a/admin/layouts/custom_admin_view/details_rightside.php +++ b/admin/layouts/custom_admin_view/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/custom_admin_view/details_under.php b/admin/layouts/custom_admin_view/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/custom_admin_view/details_under.php +++ b/admin/layouts/custom_admin_view/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/custom_admin_view/linked_components_fullwidth.php b/admin/layouts/custom_admin_view/linked_components_fullwidth.php index a355c1c60..cf21af02c 100644 --- a/admin/layouts/custom_admin_view/linked_components_fullwidth.php +++ b/admin/layouts/custom_admin_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/custom_admin_view/publishing.php +++ b/admin/layouts/custom_admin_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/custom_admin_view/publlshing.php b/admin/layouts/custom_admin_view/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/custom_admin_view/publlshing.php +++ b/admin/layouts/custom_admin_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/custom_code/details_above.php b/admin/layouts/custom_code/details_above.php index a027b5532..1ea8acd46 100644 --- a/admin/layouts/custom_code/details_above.php +++ b/admin/layouts/custom_code/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php @@ -31,7 +31,8 @@ $form = $displayData->getForm(); $fields = array( 'target', - 'system_name' + 'system_name', + 'function_name' ); ?> diff --git a/admin/layouts/custom_code/details_fullwidth.php b/admin/layouts/custom_code/details_fullwidth.php index 77d2fa681..24a7b5b89 100644 --- a/admin/layouts/custom_code/details_fullwidth.php +++ b/admin/layouts/custom_code/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php @@ -32,7 +32,8 @@ $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( 'path', 'note_jcb_placeholder', - 'code' + 'code', + 'note_placeholders_explained' ); ?> diff --git a/admin/layouts/custom_code/details_left.php b/admin/layouts/custom_code/details_left.php index 8a1885558..d2e8c62d7 100644 --- a/admin/layouts/custom_code/details_left.php +++ b/admin/layouts/custom_code/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php @@ -30,6 +30,7 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( + 'comment_type', 'component', 'type', 'hashtarget' diff --git a/admin/layouts/custom_code/details_right.php b/admin/layouts/custom_code/details_right.php index f7d9f1543..e22856175 100644 --- a/admin/layouts/custom_code/details_right.php +++ b/admin/layouts/custom_code/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/custom_code/details_under.php b/admin/layouts/custom_code/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/custom_code/details_under.php +++ b/admin/layouts/custom_code/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/custom_code/publishing.php b/admin/layouts/custom_code/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/custom_code/publishing.php +++ b/admin/layouts/custom_code/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/custom_code/publlshing.php b/admin/layouts/custom_code/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/custom_code/publlshing.php +++ b/admin/layouts/custom_code/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/dynamic_get/abacus_fullwidth.php b/admin/layouts/dynamic_get/abacus_fullwidth.php index 8fabe9d0b..8d7ece6e5 100644 --- a/admin/layouts/dynamic_get/abacus_fullwidth.php +++ b/admin/layouts/dynamic_get/abacus_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage abacus_fullwidth.php diff --git a/admin/layouts/dynamic_get/abacus_left.php b/admin/layouts/dynamic_get/abacus_left.php index 0ed4e07b6..f0e88892f 100644 --- a/admin/layouts/dynamic_get/abacus_left.php +++ b/admin/layouts/dynamic_get/abacus_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage abacus_left.php diff --git a/admin/layouts/dynamic_get/custom_script_fullwidth.php b/admin/layouts/dynamic_get/custom_script_fullwidth.php index 7c48569bc..505d61e92 100644 --- a/admin/layouts/dynamic_get/custom_script_fullwidth.php +++ b/admin/layouts/dynamic_get/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/dynamic_get/gettable_above.php b/admin/layouts/dynamic_get/gettable_above.php index 9bd2eefdd..8c5db2c4c 100644 --- a/admin/layouts/dynamic_get/gettable_above.php +++ b/admin/layouts/dynamic_get/gettable_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_above.php diff --git a/admin/layouts/dynamic_get/gettable_fullwidth.php b/admin/layouts/dynamic_get/gettable_fullwidth.php index aa4296a16..46ddfb294 100644 --- a/admin/layouts/dynamic_get/gettable_fullwidth.php +++ b/admin/layouts/dynamic_get/gettable_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_fullwidth.php diff --git a/admin/layouts/dynamic_get/gettable_left.php b/admin/layouts/dynamic_get/gettable_left.php index 267400c1c..ef7930e2b 100644 --- a/admin/layouts/dynamic_get/gettable_left.php +++ b/admin/layouts/dynamic_get/gettable_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_left.php diff --git a/admin/layouts/dynamic_get/gettable_right.php b/admin/layouts/dynamic_get/gettable_right.php index 9e078677d..8233f207a 100644 --- a/admin/layouts/dynamic_get/gettable_right.php +++ b/admin/layouts/dynamic_get/gettable_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_right.php diff --git a/admin/layouts/dynamic_get/gettable_under.php b/admin/layouts/dynamic_get/gettable_under.php index 00c9a7819..16ab6a594 100644 --- a/admin/layouts/dynamic_get/gettable_under.php +++ b/admin/layouts/dynamic_get/gettable_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_under.php diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/dynamic_get/publishing.php +++ b/admin/layouts/dynamic_get/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/dynamic_get/publlshing.php b/admin/layouts/dynamic_get/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/dynamic_get/publlshing.php +++ b/admin/layouts/dynamic_get/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/field/details_fullwidth.php b/admin/layouts/field/details_fullwidth.php index 97f93e06c..2941dc131 100644 --- a/admin/layouts/field/details_fullwidth.php +++ b/admin/layouts/field/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/field/details_left.php b/admin/layouts/field/details_left.php index abaca4959..c01757351 100644 --- a/admin/layouts/field/details_left.php +++ b/admin/layouts/field/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/field/details_right.php b/admin/layouts/field/details_right.php index 848566f95..15bf9aff0 100644 --- a/admin/layouts/field/details_right.php +++ b/admin/layouts/field/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/field/details_under.php b/admin/layouts/field/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/field/details_under.php +++ b/admin/layouts/field/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/field/linked_admin_views_fullwidth.php b/admin/layouts/field/linked_admin_views_fullwidth.php index 243533e8f..3cd6b21cc 100644 --- a/admin/layouts/field/linked_admin_views_fullwidth.php +++ b/admin/layouts/field/linked_admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_admin_views_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vzvlinked_admin_views; +$items = $displayData->vzwlinked_admin_views; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit"; diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/field/publishing.php +++ b/admin/layouts/field/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/field/publlshing.php b/admin/layouts/field/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/field/publlshing.php +++ b/admin/layouts/field/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/scripts_left.php index c4db94242..396d63244 100644 --- a/admin/layouts/field/scripts_left.php +++ b/admin/layouts/field/scripts_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage scripts_left.php diff --git a/admin/layouts/field/scripts_right.php b/admin/layouts/field/scripts_right.php index f5f10a53c..77dd19fa4 100644 --- a/admin/layouts/field/scripts_right.php +++ b/admin/layouts/field/scripts_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage scripts_right.php diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php index 6845233e1..454b37599 100644 --- a/admin/layouts/fieldtype/details_left.php +++ b/admin/layouts/fieldtype/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/fieldtype/details_right.php b/admin/layouts/fieldtype/details_right.php index 9108b3e29..7da7ab9ab 100644 --- a/admin/layouts/fieldtype/details_right.php +++ b/admin/layouts/fieldtype/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 1b296c22d..2dd41f379 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vzwfields; +$items = $displayData->vzxfields; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/fieldtype/publishing.php +++ b/admin/layouts/fieldtype/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/fieldtype/publlshing.php b/admin/layouts/fieldtype/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/fieldtype/publlshing.php +++ b/admin/layouts/fieldtype/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index dd5ac9dc6..b2ca616c7 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index 1d1649c10..7e6f81b98 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index 831660740..11dce815a 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index 2f5bef230..48a49bd1c 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index 12941c5d7..cd18ce6aa 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/layout/custom_script_fullwidth.php b/admin/layouts/layout/custom_script_fullwidth.php index a3a3b3e5f..0e97fb5d7 100644 --- a/admin/layouts/layout/custom_script_fullwidth.php +++ b/admin/layouts/layout/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/layout/details_fullwidth.php b/admin/layouts/layout/details_fullwidth.php index 5adae05af..c76c967ab 100644 --- a/admin/layouts/layout/details_fullwidth.php +++ b/admin/layouts/layout/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php index 9affba1c1..0a82b2ba6 100644 --- a/admin/layouts/layout/details_left.php +++ b/admin/layouts/layout/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/layout/details_right.php b/admin/layouts/layout/details_right.php index d75c6a53a..3082913d1 100644 --- a/admin/layouts/layout/details_right.php +++ b/admin/layouts/layout/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/layout/details_rightside.php b/admin/layouts/layout/details_rightside.php index 00b2c7f7c..1e441d2e0 100644 --- a/admin/layouts/layout/details_rightside.php +++ b/admin/layouts/layout/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/layout/details_under.php b/admin/layouts/layout/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/layout/details_under.php +++ b/admin/layouts/layout/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/layout/publishing.php b/admin/layouts/layout/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/layout/publishing.php +++ b/admin/layouts/layout/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/layout/publlshing.php b/admin/layouts/layout/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/layout/publlshing.php +++ b/admin/layouts/layout/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/site_view/custom_buttons_fullwidth.php b/admin/layouts/site_view/custom_buttons_fullwidth.php index 3aff0f330..c8e0db961 100644 --- a/admin/layouts/site_view/custom_buttons_fullwidth.php +++ b/admin/layouts/site_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/site_view/details_above.php b/admin/layouts/site_view/details_above.php index 052859caa..dd354e033 100644 --- a/admin/layouts/site_view/details_above.php +++ b/admin/layouts/site_view/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/site_view/details_fullwidth.php b/admin/layouts/site_view/details_fullwidth.php index 7820e5dc2..a635da226 100644 --- a/admin/layouts/site_view/details_fullwidth.php +++ b/admin/layouts/site_view/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php index c43bad7b7..e25e73395 100644 --- a/admin/layouts/site_view/details_left.php +++ b/admin/layouts/site_view/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/site_view/details_right.php b/admin/layouts/site_view/details_right.php index d75c6a53a..3082913d1 100644 --- a/admin/layouts/site_view/details_right.php +++ b/admin/layouts/site_view/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/site_view/details_rightside.php b/admin/layouts/site_view/details_rightside.php index b565f0f05..f35c06463 100644 --- a/admin/layouts/site_view/details_rightside.php +++ b/admin/layouts/site_view/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/site_view/details_under.php b/admin/layouts/site_view/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/site_view/details_under.php +++ b/admin/layouts/site_view/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php index b19130c10..c9898bd6f 100644 --- a/admin/layouts/site_view/javascript_css_fullwidth.php +++ b/admin/layouts/site_view/javascript_css_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage javascript_css_fullwidth.php diff --git a/admin/layouts/site_view/linked_components_fullwidth.php b/admin/layouts/site_view/linked_components_fullwidth.php index abc56b10c..87ef8212e 100644 --- a/admin/layouts/site_view/linked_components_fullwidth.php +++ b/admin/layouts/site_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php diff --git a/admin/layouts/site_view/php_fullwidth.php b/admin/layouts/site_view/php_fullwidth.php index 8b8de62c3..a7002223d 100644 --- a/admin/layouts/site_view/php_fullwidth.php +++ b/admin/layouts/site_view/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/site_view/publishing.php +++ b/admin/layouts/site_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/site_view/publlshing.php b/admin/layouts/site_view/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/site_view/publlshing.php +++ b/admin/layouts/site_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/snippet/details_above.php b/admin/layouts/snippet/details_above.php index ff07416d2..3b78540e7 100644 --- a/admin/layouts/snippet/details_above.php +++ b/admin/layouts/snippet/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/snippet/details_left.php b/admin/layouts/snippet/details_left.php index 19024d577..0516da4c1 100644 --- a/admin/layouts/snippet/details_left.php +++ b/admin/layouts/snippet/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/snippet/details_right.php b/admin/layouts/snippet/details_right.php index b77782939..e334523db 100644 --- a/admin/layouts/snippet/details_right.php +++ b/admin/layouts/snippet/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/snippet/publishing.php +++ b/admin/layouts/snippet/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/snippet/publlshing.php b/admin/layouts/snippet/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/snippet/publlshing.php +++ b/admin/layouts/snippet/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/template/custom_script_fullwidth.php b/admin/layouts/template/custom_script_fullwidth.php index a3a3b3e5f..0e97fb5d7 100644 --- a/admin/layouts/template/custom_script_fullwidth.php +++ b/admin/layouts/template/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/template/details_fullwidth.php b/admin/layouts/template/details_fullwidth.php index 746f5d209..def4abea7 100644 --- a/admin/layouts/template/details_fullwidth.php +++ b/admin/layouts/template/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/template/details_left.php b/admin/layouts/template/details_left.php index 9affba1c1..0a82b2ba6 100644 --- a/admin/layouts/template/details_left.php +++ b/admin/layouts/template/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/template/details_right.php b/admin/layouts/template/details_right.php index d75c6a53a..3082913d1 100644 --- a/admin/layouts/template/details_right.php +++ b/admin/layouts/template/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/template/details_rightside.php b/admin/layouts/template/details_rightside.php index 00b2c7f7c..1e441d2e0 100644 --- a/admin/layouts/template/details_rightside.php +++ b/admin/layouts/template/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/template/details_under.php b/admin/layouts/template/details_under.php index 3633301b6..7d2fe0d3d 100644 --- a/admin/layouts/template/details_under.php +++ b/admin/layouts/template/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/template/publishing.php b/admin/layouts/template/publishing.php index b4eff650f..b09028687 100644 --- a/admin/layouts/template/publishing.php +++ b/admin/layouts/template/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/template/publlshing.php b/admin/layouts/template/publlshing.php index 7574cb5b5..e1cf845e6 100644 --- a/admin/layouts/template/publlshing.php +++ b/admin/layouts/template/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/models/ajax.php b/admin/models/ajax.php index f8c97b480..377668ee0 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage ajax.php @@ -1262,10 +1262,6 @@ class ComponentbuilderModelAjax extends JModelList return $db->loadResult(); } return ''; - } - - protected function splitAtUpperCase($s) { - return preg_split('/(?=[A-Z])/', $s, -1, PREG_SPLIT_NO_EMPTY); } // Used in dynamic_get @@ -1438,6 +1434,37 @@ class ComponentbuilderModelAjax extends JModelList return false; } + // Used in custom_code + public function checkFunctionName($name, $id) + { + $nameArray = (array) $this->splitAtUpperCase($name); + $name = ComponentbuilderHelper::safeString(implode(' ', $nameArray), 'cA'); + if ($found = ComponentbuilderHelper::getVar('custom_code', $name, 'function_name', 'id')) + { + if ((int) $id !== (int) $found) + { + return array ( + 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_FUNCTION_NAME_IS_ALREADY_IN_USE'), + 'status' => 'danger'); + } + } + return array ( + 'name' => $name, + 'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK'), + 'status' => 'success'); + } + + protected function splitAtUpperCase($string) + { + return preg_split('/(?=[A-Z])/', $string, -1, PREG_SPLIT_NO_EMPTY); + } + + public function usedin($name, $id) + { + // search where this function is being used + return array('in' => 'Soon we will show where this function is being used'); + } + // Used in field public function getFieldOptions($id) { diff --git a/admin/models/compiler.php b/admin/models/compiler.php index ef90dc195..5289c30fc 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 11 of this MVC - @build 2nd February, 2017 + @version @update number 17 of this MVC + @build 13th February, 2017 @created 1st February, 2017 @package Component Builder @subpackage compiler.php @@ -163,14 +163,16 @@ class ComponentbuilderModelCompiler extends JModelList return $db->loadObjectList(); } - public function builder($version,$id,$backup,$git) + public function builder($version, $id, $backup, $git, $addPlaceholders, $debugLinenr) { - $set['joomlaVersion'] = $version; - $set['componentId'] = $id; - $set['addBackup'] = $backup; - $set['addGit'] = $git; + $set['joomlaVersion'] = $version; + $set['componentId'] = $id; + $set['addBackup'] = $backup; + $set['addGit'] = $git; + $set['addPlaceholders'] = $addPlaceholders; + $set['debugLinenr'] = $debugLinenr; // start up Compiler - $this->compiler = new Compiler($set); + $this->compiler = new Compiler($set); if($this->compiler){ return true; } @@ -184,7 +186,8 @@ class ComponentbuilderModelCompiler extends JModelList 'files' => $this->compiler->fileCount, 'folders' => $this->compiler->folderCount, 'filePath' => $this->compiler->filepath, - 'filename' => $this->compiler->componentFolderName + 'filename' => $this->compiler->componentFolderName, + 'time' => $this->compiler->secondsCompiled ); } diff --git a/admin/models/component.php b/admin/models/component.php index a59ad79bc..577ece29d 100644 --- a/admin/models/component.php +++ b/admin/models/component.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage component.php diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index fed99708a..b7f7358e3 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/models/components.php b/admin/models/components.php index d852bbb38..b343e9a3b 100644 --- a/admin/models/components.php +++ b/admin/models/components.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage components.php diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index 1d0f53e52..b208be3fd 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.php diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index c07c73eaa..062a180a5 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.php @@ -47,7 +47,8 @@ class ComponentbuilderModelCustom_codes extends JModelList 'a.component','component', 'a.path','path', 'a.target','target', - 'a.type','type' + 'a.type','type', + 'a.comment_type','comment_type' ); } @@ -78,7 +79,10 @@ class ComponentbuilderModelCustom_codes extends JModelList $this->setState('filter.target', $target); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); - $this->setState('filter.type', $type); + $this->setState('filter.type', $type); + + $comment_type = $this->getUserStateFromRequest($this->context . '.filter.comment_type', 'filter_comment_type'); + $this->setState('filter.comment_type', $comment_type); $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); $this->setState('filter.sorting', $sorting); @@ -140,6 +144,10 @@ class ComponentbuilderModelCustom_codes extends JModelList { $item->component_system_name = $item->system_name; $item->path = '[CUSTO'.'MCODE='.$item->id.']'; // so it is not detected + if (ComponentbuilderHelper::checkString($item->function_name)) + { + $item->path = '[CUSTO'.'MCODE='.$item->function_name.']'; // so it is not detected + } $item->type = 2; } } @@ -154,6 +162,8 @@ class ComponentbuilderModelCustom_codes extends JModelList $item->target = $this->selectionTranslation($item->target, 'target'); // convert type $item->type = $this->selectionTranslation($item->type, 'type'); + // convert comment_type + $item->comment_type = $this->selectionTranslation($item->comment_type, 'comment_type'); } } @@ -173,8 +183,8 @@ class ComponentbuilderModelCustom_codes extends JModelList if ($name === 'target') { $targetArray = array( - 1 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_HASH_AUTOMATION', - 2 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_JCB_MANUAL' + 2 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_JCB_MANUAL', + 1 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_HASH_AUTOMATION' ); // Now check if value is found in this array if (isset($targetArray[$value]) && ComponentbuilderHelper::checkString($targetArray[$value])) @@ -195,6 +205,19 @@ class ComponentbuilderModelCustom_codes extends JModelList return $typeArray[$value]; } } + // Array of comment_type language strings + if ($name === 'comment_type') + { + $comment_typeArray = array( + 1 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_PHPJS', + 2 => 'COM_COMPONENTBUILDER_CUSTOM_CODE_HTML' + ); + // Now check if value is found in this array + if (isset($comment_typeArray[$value]) && ComponentbuilderHelper::checkString($comment_typeArray[$value])) + { + return $comment_typeArray[$value]; + } + } return $value; } @@ -257,7 +280,7 @@ class ComponentbuilderModelCustom_codes extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.component LIKE '.$search.' OR g.system_name LIKE '.$search.')'); + $query->where('(a.component LIKE '.$search.' OR g.system_name LIKE '.$search.' OR a.comment_type LIKE '.$search.')'); } } @@ -276,6 +299,11 @@ class ComponentbuilderModelCustom_codes extends JModelList { $query->where('a.type = ' . $db->quote($db->escape($type))); } + // Filter by Comment_type. + if ($comment_type = $this->getState('filter.comment_type')) + { + $query->where('a.comment_type = ' . $db->quote($db->escape($comment_type))); + } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); @@ -366,6 +394,10 @@ class ComponentbuilderModelCustom_codes extends JModelList { $item->component_system_name = $item->system_name; $item->path = '[CUSTO'.'MCODE='.$item->id.']'; // so it is not detected + if (ComponentbuilderHelper::checkString($item->function_name)) + { + $item->path = '[CUSTO'.'MCODE='.$item->function_name.']'; // so it is not detected + } $item->type = 2; } } @@ -421,7 +453,8 @@ class ComponentbuilderModelCustom_codes extends JModelList $id .= ':' . $this->getState('filter.component'); $id .= ':' . $this->getState('filter.path'); $id .= ':' . $this->getState('filter.target'); - $id .= ':' . $this->getState('filter.type'); + $id .= ':' . $this->getState('filter.type'); + $id .= ':' . $this->getState('filter.comment_type'); return parent::getStoreId($id); } diff --git a/admin/models/field.php b/admin/models/field.php index 34ad25213..2073c0ca4 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -141,7 +141,7 @@ class ComponentbuilderModelField extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVzvlinked_admin_views() + public function getVzwlinked_admin_views() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index 3410565e6..1df5bef37 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage adminviewfolderlist.php diff --git a/admin/models/fields/adminviews.php b/admin/models/fields/adminviews.php index 55e28550d..ba1debf5c 100644 --- a/admin/models/fields/adminviews.php +++ b/admin/models/fields/adminviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage adminviews.php diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index 332ad58f2..e299325cd 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage articles.php diff --git a/admin/models/fields/component.php b/admin/models/fields/component.php index fa3309cf0..590d08701 100644 --- a/admin/models/fields/component.php +++ b/admin/models/fields/component.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage component.php diff --git a/admin/models/fields/customadminviews.php b/admin/models/fields/customadminviews.php index c52dd6dcb..2661d04a2 100644 --- a/admin/models/fields/customadminviews.php +++ b/admin/models/fields/customadminviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage customadminviews.php diff --git a/admin/models/fields/customfilelist.php b/admin/models/fields/customfilelist.php index 77111dc8c..ba517b07d 100644 --- a/admin/models/fields/customfilelist.php +++ b/admin/models/fields/customfilelist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage customfilelist.php diff --git a/admin/models/fields/customfolderlist.php b/admin/models/fields/customfolderlist.php index 37eb0ec95..5f5087041 100644 --- a/admin/models/fields/customfolderlist.php +++ b/admin/models/fields/customfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage customfolderlist.php diff --git a/admin/models/fields/customgets.php b/admin/models/fields/customgets.php index 48e68ca02..bcdc7d181 100644 --- a/admin/models/fields/customgets.php +++ b/admin/models/fields/customgets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage customgets.php diff --git a/admin/models/fields/dbtables.php b/admin/models/fields/dbtables.php index 3594846e9..f96bc7907 100644 --- a/admin/models/fields/dbtables.php +++ b/admin/models/fields/dbtables.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage dbtables.php diff --git a/admin/models/fields/dynamicgets.php b/admin/models/fields/dynamicgets.php index 4c4344253..a44e088ba 100644 --- a/admin/models/fields/dynamicgets.php +++ b/admin/models/fields/dynamicgets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamicgets.php diff --git a/admin/models/fields/fields.php b/admin/models/fields/fields.php index 7f2e735d6..93c8dbd6c 100644 --- a/admin/models/fields/fields.php +++ b/admin/models/fields/fields.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields.php diff --git a/admin/models/fields/fieldsmulti.php b/admin/models/fields/fieldsmulti.php index 1a0db769b..beb248898 100644 --- a/admin/models/fields/fieldsmulti.php +++ b/admin/models/fields/fieldsmulti.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage fieldsmulti.php diff --git a/admin/models/fields/fieldtypes.php b/admin/models/fields/fieldtypes.php index d0a3a098a..becec8481 100644 --- a/admin/models/fields/fieldtypes.php +++ b/admin/models/fields/fieldtypes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage fieldtypes.php diff --git a/admin/models/fields/maingets.php b/admin/models/fields/maingets.php index 5cc0774ce..b995840fa 100644 --- a/admin/models/fields/maingets.php +++ b/admin/models/fields/maingets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage maingets.php diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index 8da2d59f1..d42d521d7 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage siteviewfolderlist.php diff --git a/admin/models/fields/siteviews.php b/admin/models/fields/siteviews.php index 1d33bcd81..34928d07b 100644 --- a/admin/models/fields/siteviews.php +++ b/admin/models/fields/siteviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage siteviews.php diff --git a/admin/models/fields/snippets.php b/admin/models/fields/snippets.php index 2e4986d5f..dcbcf9723 100644 --- a/admin/models/fields/snippets.php +++ b/admin/models/fields/snippets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage snippets.php diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 53ea80cd8..2de6f33fb 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -111,7 +111,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVzwfields() + public function getVzxfields() { // Get the user object. $user = JFactory::getUser(); @@ -195,13 +195,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVzwfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVzxfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVzwfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVzxfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVzwfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVzxfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVzwfields($item->store, 'store'); + $item->store = $this->selectionTranslationVzxfields($item->store, 'store'); } } @@ -215,7 +215,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationVzwfields($value,$name) + public function selectionTranslationVzxfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') diff --git a/admin/models/forms/component.js b/admin/models/forms/component.js index 241be45ee..fdaa76277 100644 --- a/admin/models/forms/component.js +++ b/admin/models/forms/component.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage component.js diff --git a/admin/models/forms/custom_code.js b/admin/models/forms/custom_code.js index a289e956a..a6f53f5d0 100644 --- a/admin/models/forms/custom_code.js +++ b/admin/models/forms/custom_code.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.js @@ -23,9 +23,10 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvzpvzk_required = false; +jform_vvvvvzovzk_required = false; jform_vvvvvzpvzl_required = false; jform_vvvvvzpvzm_required = false; +jform_vvvvvzpvzn_required = false; // Initial Script jQuery(document).ready(function() @@ -51,11 +52,30 @@ function vvvvvzo(target_vvvvvzo) // set the function logic if (target_vvvvvzo == 2) { + jQuery('#jform_function_name').closest('.control-group').show(); + if (jform_vvvvvzovzk_required) + { + updateFieldRequired('function_name',0); + jQuery('#jform_function_name').prop('required','required'); + jQuery('#jform_function_name').attr('aria-required',true); + jQuery('#jform_function_name').addClass('required'); + jform_vvvvvzovzk_required = false; + } + jQuery('.note_jcb_placeholder').closest('.control-group').show(); jQuery('#jform_system_name').closest('.control-group').show(); } else { + jQuery('#jform_function_name').closest('.control-group').hide(); + if (!jform_vvvvvzovzk_required) + { + updateFieldRequired('function_name',1); + jQuery('#jform_function_name').removeAttr('required'); + jQuery('#jform_function_name').removeAttr('aria-required'); + jQuery('#jform_function_name').removeClass('required'); + jform_vvvvvzovzk_required = true; + } jQuery('.note_jcb_placeholder').closest('.control-group').hide(); jQuery('#jform_system_name').closest('.control-group').hide(); } @@ -68,70 +88,70 @@ function vvvvvzp(target_vvvvvzp) if (target_vvvvvzp == 1) { jQuery('#jform_component').closest('.control-group').show(); - if (jform_vvvvvzpvzk_required) + if (jform_vvvvvzpvzl_required) { updateFieldRequired('component',0); jQuery('#jform_component').prop('required','required'); jQuery('#jform_component').attr('aria-required',true); jQuery('#jform_component').addClass('required'); - jform_vvvvvzpvzk_required = false; + jform_vvvvvzpvzl_required = false; } jQuery('#jform_path').closest('.control-group').show(); - if (jform_vvvvvzpvzl_required) + if (jform_vvvvvzpvzm_required) { updateFieldRequired('path',0); jQuery('#jform_path').prop('required','required'); jQuery('#jform_path').attr('aria-required',true); jQuery('#jform_path').addClass('required'); - jform_vvvvvzpvzl_required = false; + jform_vvvvvzpvzm_required = false; } jQuery('#jform_from_line').closest('.control-group').show(); jQuery('#jform_hashtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); jQuery('#jform_type').closest('.control-group').show(); - if (jform_vvvvvzpvzm_required) + if (jform_vvvvvzpvzn_required) { updateFieldRequired('type',0); jQuery('#jform_type').prop('required','required'); jQuery('#jform_type').attr('aria-required',true); jQuery('#jform_type').addClass('required'); - jform_vvvvvzpvzm_required = false; + jform_vvvvvzpvzn_required = false; } } else { jQuery('#jform_component').closest('.control-group').hide(); - if (!jform_vvvvvzpvzk_required) + if (!jform_vvvvvzpvzl_required) { updateFieldRequired('component',1); jQuery('#jform_component').removeAttr('required'); jQuery('#jform_component').removeAttr('aria-required'); jQuery('#jform_component').removeClass('required'); - jform_vvvvvzpvzk_required = true; + jform_vvvvvzpvzl_required = true; } jQuery('#jform_path').closest('.control-group').hide(); - if (!jform_vvvvvzpvzl_required) + if (!jform_vvvvvzpvzm_required) { updateFieldRequired('path',1); jQuery('#jform_path').removeAttr('required'); jQuery('#jform_path').removeAttr('aria-required'); jQuery('#jform_path').removeClass('required'); - jform_vvvvvzpvzl_required = true; + jform_vvvvvzpvzm_required = true; } jQuery('#jform_from_line').closest('.control-group').hide(); jQuery('#jform_hashtarget').closest('.control-group').hide(); jQuery('#jform_to_line').closest('.control-group').hide(); jQuery('#jform_type').closest('.control-group').hide(); - if (!jform_vvvvvzpvzm_required) + if (!jform_vvvvvzpvzn_required) { updateFieldRequired('type',1); jQuery('#jform_type').removeAttr('required'); jQuery('#jform_type').removeAttr('aria-required'); jQuery('#jform_type').removeClass('required'); - jform_vvvvvzpvzm_required = true; + jform_vvvvvzpvzn_required = true; } } } @@ -202,4 +222,103 @@ function isSet(val) return true; } return false; +} + +jQuery(document).ready(function() +{ + var target = jQuery("#jform_target input[type='radio']:checked").val(); + if (target == 2) { + var functioName = jQuery('#jform_function_name').val(); + // check if this function name is taken + checkFunctionName(functioName); + } +}); +function setCustomCodePlaceholder() { + var ide = jQuery('#jform_id').val(); + var functioName = jQuery('#jform_function_name').val(); + if (ide > 0 && functioName.length > 2) { + jQuery('#jcb-placeholder').html('[CUSTO'+'MCODE='+ide+'] or [CUSTO'+'MCODE='+functioName+']'); + jQuery('#jcb-placeholder-arg').html('[CUSTO'+'MCODE='+ide+'+value1,value2] or [CUSTO'+'MCODE='+functioName+'+value1,value2]'); + } else if (ide > 0){ + jQuery('#jcb-placeholder').html('[CUSTO'+'MCODE='+ide+'] or [not ready]'); + jQuery('#jcb-placeholder-arg').html('[CUSTO'+'MCODE='+ide+'+value1,value2] or [not ready]'); + } else if (functioName.length > 2) { + jQuery('#jcb-placeholder').html('[save to see] or [CUSTO'+'MCODE='+functioName+']'); + jQuery('#jcb-placeholder-arg').html('[save to see] or [CUSTO'+'MCODE='+functioName+'+value1,value2]'); + } else { + jQuery('#jcb-placeholder').html('[save to see]'); + jQuery('#jcb-placeholder-arg').html('[save to see]'); + } + // update the notes + if (ide > 0) { + jQuery('.placeholder-key-id').text(ide); + } +} +function checkFunctionName(functioName) { + if (functioName.length > 2) { + var ide = jQuery('#jform_id').val(); + if (ide == 0) { + ide = -1; + } + checkFunctionName_server(functioName, ide).done(function(result) { + if(result.name && result.message){ + // show notice that functioName is okay + jQuery.UIkit.notify({message: result.message, timeout: 5000, status: result.status, pos: 'top-right'}); + jQuery('#jform_function_name').val(result.name); + // now start search for where the function is used + usedin(result.name, ide); + } else if(result.message){ + // show notice that functioName is not okay + jQuery.UIkit.notify({message: result.message, timeout: 5000, status: result.status, pos: 'top-right'}); + jQuery('#jform_function_name').val(''); + } else { + // set an error that message was not send + jQuery.UIkit.notify({message: 'Function name already taken, please try again.', timeout: 5000, status: 'danger', pos: 'top-right'}); + jQuery('#jform_function_name').val(''); + } + // set custom code placeholder + setCustomCodePlaceholder(); + }); + } else { + // set an error that message was not send + jQuery.UIkit.notify({message: 'You must add an unique function name.', timeout: 5000, status: 'danger', pos: 'top-right'}); + jQuery('#jform_function_name').val(''); + // set custom code placeholder + setCustomCodePlaceholder(); + } +} +// check Function Name +function checkFunctionName_server(functioName, ide){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.checkFunctionName&format=json"; + if(token.length > 0){ + var request = 'token='+token+'&functioName='+functioName+'&id='+ide; + } + return jQuery.ajax({ + type: 'POST', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} +// check where this Function is used +function usedin(functioName, ide) { + usedin_server(functioName, ide).done(function(used) { + if (used.in) { + jQuery('#usedin').html(used.in); + } + }); +} +function usedin_server(functioName, ide){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.usedin&format=json"; + if(token.length > 0){ + var request = 'token='+token+'&functioName='+functioName+'&id='+ide; + } + return jQuery.ajax({ + type: 'POST', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); } diff --git a/admin/models/forms/custom_code.xml b/admin/models/forms/custom_code.xml index 72bf031c0..2a5d09d77 100644 --- a/admin/models/forms/custom_code.xml +++ b/admin/models/forms/custom_code.xml @@ -123,12 +123,12 @@ label="COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL" description="COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_DESCRIPTION" class="btn-group btn-group-yesno" - default="1"> + default="2"> - + COM_COMPONENTBUILDER_CUSTOM_CODE_INSERTION - + - + type="radio" + name="comment_type" + label="COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL" + description="COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_DESCRIPTION" + class="btn-group btn-group-yesno" + default="1" + required="true"> + + + + + - - - - - + + + + + + + + + + + '; + $xml .= ' '; $xml .= ""; // prepare the xml $sales = new SimpleXMLElement($xml); @@ -94,18 +94,38 @@ class ComponentbuilderViewCompiler extends JViewLegacy $radio2 = JFormHelper::loadFieldType('radio',true); // start building add to git folder xml field - $xml = ''; - $xml .= ' '; + $xml = ''; + $xml .= ' '; $xml .= ""; // prepare the xml $git = new SimpleXMLElement($xml); // set components to form $radio2->setup($git,1); + $radio3 = JFormHelper::loadFieldType('radio',true); + // start building add to git folder xml field + $xml = ''; + $xml .= ' '; + $xml .= ""; + // prepare the xml + $placeholder = new SimpleXMLElement($xml); + // set components to form + $radio3->setup($placeholder,2); + + $radio4 = JFormHelper::loadFieldType('radio',true); + // start building add to git folder xml field + $xml = ''; + $xml .= ' '; + $xml .= ""; + // prepare the xml + $debug_linenr = new SimpleXMLElement($xml); + // set components to form + $radio4->setup($debug_linenr,2); + $list = JFormHelper::loadFieldType('list',true); // start building componet xml field - $xml = ''; - $xml .= ''; + $xml = ''; + $xml .= ''; foreach($this->Components as $componet){ $xml .= ''; } @@ -115,7 +135,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy // set components to form $list->setup($componets,0); - return array($radio1,$radio2,$list); + return array($radio1,$radio2,$radio3,$radio4,$list); } return false; } diff --git a/admin/views/component/submitbutton.js b/admin/views/component/submitbutton.js index 158ad02ad..9b571c2db 100644 --- a/admin/views/component/submitbutton.js +++ b/admin/views/component/submitbutton.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/component/tmpl/edit.php b/admin/views/component/tmpl/edit.php index 29bd21b0b..5ab024585 100644 --- a/admin/views/component/tmpl/edit.php +++ b/admin/views/component/tmpl/edit.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage edit.php diff --git a/admin/views/component/view.html.php b/admin/views/component/view.html.php index faf695877..b604a0aff 100644 --- a/admin/views/component/view.html.php +++ b/admin/views/component/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage view.html.php @@ -196,7 +196,9 @@ class ComponentbuilderViewComponent extends JViewLegacy $isNew = ($this->item->id < 1); $document = JFactory::getDocument(); $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_EDIT')); - $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component.css"); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component.css"); + // Add Ajax Token + $document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); // Add the CSS for Footable $document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'); diff --git a/admin/views/componentbuilder/tmpl/default.php b/admin/views/componentbuilder/tmpl/default.php index 053e33c16..93ffab119 100644 --- a/admin/views/componentbuilder/tmpl/default.php +++ b/admin/views/componentbuilder/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php index 22160e7f7..105f9a74c 100644 --- a/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php +++ b/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_closed_issues_the_closed_issues_on_github.php diff --git a/admin/views/componentbuilder/tmpl/default_main.php b/admin/views/componentbuilder/tmpl/default_main.php index 2425c1d3e..cb230e72c 100644 --- a/admin/views/componentbuilder/tmpl/default_main.php +++ b/admin/views/componentbuilder/tmpl/default_main.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_main.php diff --git a/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php index 7e0abbbe3..56f02955c 100644 --- a/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php +++ b/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_open_issues_the_open_issues_on_github.php diff --git a/admin/views/componentbuilder/tmpl/default_readme_information.php b/admin/views/componentbuilder/tmpl/default_readme_information.php index 00741954a..1458df915 100644 --- a/admin/views/componentbuilder/tmpl/default_readme_information.php +++ b/admin/views/componentbuilder/tmpl/default_readme_information.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_readme_information.php diff --git a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php index 9c8b23ee2..80a2ebf6e 100644 --- a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php +++ b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_vast_development_method_notice_board.php diff --git a/admin/views/componentbuilder/tmpl/default_vdm.php b/admin/views/componentbuilder/tmpl/default_vdm.php index 53e63b02a..4666c0e5b 100644 --- a/admin/views/componentbuilder/tmpl/default_vdm.php +++ b/admin/views/componentbuilder/tmpl/default_vdm.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_vdm.php diff --git a/admin/views/componentbuilder/view.html.php b/admin/views/componentbuilder/view.html.php index 7f7a07eec..08bad66ca 100644 --- a/admin/views/componentbuilder/view.html.php +++ b/admin/views/componentbuilder/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/components/tmpl/default.php b/admin/views/components/tmpl/default.php index 5a91aac32..6b5582c68 100644 --- a/admin/views/components/tmpl/default.php +++ b/admin/views/components/tmpl/default.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/components/tmpl/default_batch_body.php b/admin/views/components/tmpl/default_batch_body.php index 9e60f2996..f4ae4f5b4 100644 --- a/admin/views/components/tmpl/default_batch_body.php +++ b/admin/views/components/tmpl/default_batch_body.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/components/tmpl/default_batch_footer.php b/admin/views/components/tmpl/default_batch_footer.php index 74b49d6ea..e5f021bd2 100644 --- a/admin/views/components/tmpl/default_batch_footer.php +++ b/admin/views/components/tmpl/default_batch_footer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/components/tmpl/default_body.php b/admin/views/components/tmpl/default_body.php index b15ab48c3..76bd6f050 100644 --- a/admin/views/components/tmpl/default_body.php +++ b/admin/views/components/tmpl/default_body.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_body.php diff --git a/admin/views/components/tmpl/default_foot.php b/admin/views/components/tmpl/default_foot.php index ab6bdc5c8..42bb20358 100644 --- a/admin/views/components/tmpl/default_foot.php +++ b/admin/views/components/tmpl/default_foot.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/components/tmpl/default_head.php b/admin/views/components/tmpl/default_head.php index 594254004..d36602760 100644 --- a/admin/views/components/tmpl/default_head.php +++ b/admin/views/components/tmpl/default_head.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_head.php diff --git a/admin/views/components/tmpl/default_toolbar.php b/admin/views/components/tmpl/default_toolbar.php index fa5a75f7c..26bfb4d1f 100644 --- a/admin/views/components/tmpl/default_toolbar.php +++ b/admin/views/components/tmpl/default_toolbar.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/components/view.html.php b/admin/views/components/view.html.php index 11039394d..c5a08f546 100644 --- a/admin/views/components/view.html.php +++ b/admin/views/components/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 81 of this MVC - @build 3rd February, 2017 + @build 13th February, 2017 @created 6th May, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/custom_code/submitbutton.js b/admin/views/custom_code/submitbutton.js index 6aad34ad8..80a8a9602 100644 --- a/admin/views/custom_code/submitbutton.js +++ b/admin/views/custom_code/submitbutton.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/custom_code/tmpl/edit.php b/admin/views/custom_code/tmpl/edit.php index d9f54535f..33c3d32ac 100644 --- a/admin/views/custom_code/tmpl/edit.php +++ b/admin/views/custom_code/tmpl/edit.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage edit.php @@ -224,9 +224,24 @@ jQuery('#adminForm').on('change', '#jform_target',function (e) }); -var ide = jQuery('#jform_id').val(); -if (ide > 0) { - jQuery('#jcb-placeholder').html(' [CUSTO'+'MCODE='+ide+'] '); - jQuery('#jcb-placeholder-arg').html(' [CUSTO'+'MCODE='+ide+'+value1,value2] '); -} +jQuery('#adminForm').on('change', '#jform_function_name',function (e) +{ + e.preventDefault(); + var target = jQuery("#jform_target input[type='radio']:checked").val(); + if (target == 2) { + var functioName = jQuery('#jform_function_name').val(); + // check if this function name is taken + checkFunctionName(functioName); + } +}); +jQuery('#adminForm').on('change', '#jform_target',function (e) +{ + e.preventDefault(); + var target = jQuery("#jform_target input[type='radio']:checked").val(); + if (target == 2) { + var functioName = jQuery('#jform_function_name').val(); + // check if this function name is taken + checkFunctionName(functioName); + } +}); diff --git a/admin/views/custom_code/view.html.php b/admin/views/custom_code/view.html.php index 3e08760af..eee230771 100644 --- a/admin/views/custom_code/view.html.php +++ b/admin/views/custom_code/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage view.html.php @@ -192,9 +192,17 @@ class ComponentbuilderViewCustom_code extends JViewLegacy $isNew = ($this->item->id < 1); $document = JFactory::getDocument(); $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CUSTOM_CODE_NEW' : 'COM_COMPONENTBUILDER_CUSTOM_CODE_EDIT')); - $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/custom_code.css"); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/custom_code.css"); + // Add Ajax Token + $document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $document->addScript(JURI::root() . $this->script); - $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_code/submitbutton.js"); + $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_code/submitbutton.js"); + // add JavaScripts + $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/uikit.min.js' ); + $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/components/notify.min.js', 'text/javascript', true); + // add the style sheets + $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/uikit.gradient.min.css' ); + $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/components/notify.gradient.min.css' ); JText::script('view not acceptable. Error'); } } diff --git a/admin/views/custom_codes/tmpl/default.php b/admin/views/custom_codes/tmpl/default.php index 9b48284ef..52a810615 100644 --- a/admin/views/custom_codes/tmpl/default.php +++ b/admin/views/custom_codes/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default.php diff --git a/admin/views/custom_codes/tmpl/default_batch_body.php b/admin/views/custom_codes/tmpl/default_batch_body.php index 2879a118d..a4123f2d0 100644 --- a/admin/views/custom_codes/tmpl/default_batch_body.php +++ b/admin/views/custom_codes/tmpl/default_batch_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/custom_codes/tmpl/default_batch_footer.php b/admin/views/custom_codes/tmpl/default_batch_footer.php index 50ec44b32..93753e5fb 100644 --- a/admin/views/custom_codes/tmpl/default_batch_footer.php +++ b/admin/views/custom_codes/tmpl/default_batch_footer.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/custom_codes/tmpl/default_body.php b/admin/views/custom_codes/tmpl/default_body.php index 1ce511ea0..40d366f3a 100644 --- a/admin/views/custom_codes/tmpl/default_body.php +++ b/admin/views/custom_codes/tmpl/default_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_body.php @@ -95,6 +95,9 @@ $edit = "index.php?option=com_componentbuilder&view=custom_codes&task=custom_cod type); ?> + + comment_type); ?> + get('custom_code.edit.state')) : ?> checked_out) : ?> diff --git a/admin/views/custom_codes/tmpl/default_foot.php b/admin/views/custom_codes/tmpl/default_foot.php index 0ddbaf173..832e33e0d 100644 --- a/admin/views/custom_codes/tmpl/default_foot.php +++ b/admin/views/custom_codes/tmpl/default_foot.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_foot.php @@ -28,5 +28,5 @@ defined('_JEXEC') or die('Restricted access'); ?> - pagination->getListFooter(); ?> + pagination->getListFooter(); ?> \ No newline at end of file diff --git a/admin/views/custom_codes/tmpl/default_head.php b/admin/views/custom_codes/tmpl/default_head.php index 01281b61e..708810729 100644 --- a/admin/views/custom_codes/tmpl/default_head.php +++ b/admin/views/custom_codes/tmpl/default_head.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_head.php @@ -55,6 +55,9 @@ defined('_JEXEC') or die('Restricted access'); listDirn, $this->listOrder); ?> + + listDirn, $this->listOrder); ?> + canState): ?> listDirn, $this->listOrder); ?> diff --git a/admin/views/custom_codes/tmpl/default_toolbar.php b/admin/views/custom_codes/tmpl/default_toolbar.php index e832b4a1c..32f36ce12 100644 --- a/admin/views/custom_codes/tmpl/default_toolbar.php +++ b/admin/views/custom_codes/tmpl/default_toolbar.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index b21ac1864..8d98f56b8 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 10th February, 2017 + @version @update number 55 of this MVC + @build 13th February, 2017 @created 11th October, 2016 @package Component Builder @subpackage view.html.php @@ -266,6 +266,28 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy JHtml::_('select.options', $this->typeOptions, 'value', 'text') ); } + } + + // Set Comment Type Selection + $this->comment_typeOptions = $this->getTheComment_typeSelections(); + if ($this->comment_typeOptions) + { + // Comment Type Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', + 'filter_comment_type', + JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text', $this->state->get('filter.comment_type')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Comment Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', + 'batch[comment_type]', + JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text') + ); + } } } @@ -313,6 +335,7 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy 'a.path' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL'), 'a.target' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL'), 'a.type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL'), + 'a.comment_type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') ); } @@ -387,5 +410,41 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy return $_filter; } return false; + } + + protected function getTheComment_typeSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('comment_type')); + $query->from($db->quoteName('#__componentbuilder_custom_code')); + $query->order($db->quoteName('comment_type') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $comment_type) + { + // Translate the comment_type selection + $text = $model->selectionTranslation($comment_type,'comment_type'); + // Now add the comment_type and its text to the options array + $_filter[] = JHtml::_('select.option', $comment_type, JText::_($text)); + } + return $_filter; + } + return false; } } diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index ffaaef1d7..1d07918f5 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewField extends JViewLegacy } // Get Linked view data - $this->vzvlinked_admin_views = $this->get('Vzvlinked_admin_views'); + $this->vzwlinked_admin_views = $this->get('Vzwlinked_admin_views'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/fieldtype/view.html.php b/admin/views/fieldtype/view.html.php index 941ed002b..69f18d7c0 100644 --- a/admin/views/fieldtype/view.html.php +++ b/admin/views/fieldtype/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy } // Get Linked view data - $this->vzwfields = $this->get('Vzwfields'); + $this->vzxfields = $this->get('Vzxfields'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 2020673dd..3f657a04e 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index 633978245..8c12fd198 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/layout/submitbutton.js b/admin/views/layout/submitbutton.js index de8d81193..954b6a0b7 100644 --- a/admin/views/layout/submitbutton.js +++ b/admin/views/layout/submitbutton.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index cfe0fc440..45da7e929 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage edit.php diff --git a/admin/views/layout/view.html.php b/admin/views/layout/view.html.php index 7cf78e016..5ed31f7c7 100644 --- a/admin/views/layout/view.html.php +++ b/admin/views/layout/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/layouts/tmpl/default.php b/admin/views/layouts/tmpl/default.php index ce684fa9c..665f2de61 100644 --- a/admin/views/layouts/tmpl/default.php +++ b/admin/views/layouts/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/layouts/tmpl/default_batch_body.php b/admin/views/layouts/tmpl/default_batch_body.php index d8b01ed04..ff069eb00 100644 --- a/admin/views/layouts/tmpl/default_batch_body.php +++ b/admin/views/layouts/tmpl/default_batch_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/layouts/tmpl/default_batch_footer.php b/admin/views/layouts/tmpl/default_batch_footer.php index 9a360c2ce..ea1dab9a8 100644 --- a/admin/views/layouts/tmpl/default_batch_footer.php +++ b/admin/views/layouts/tmpl/default_batch_footer.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/layouts/tmpl/default_body.php b/admin/views/layouts/tmpl/default_body.php index d326efa49..572d2941e 100644 --- a/admin/views/layouts/tmpl/default_body.php +++ b/admin/views/layouts/tmpl/default_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_body.php diff --git a/admin/views/layouts/tmpl/default_foot.php b/admin/views/layouts/tmpl/default_foot.php index ed923d212..b73c307c1 100644 --- a/admin/views/layouts/tmpl/default_foot.php +++ b/admin/views/layouts/tmpl/default_foot.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/layouts/tmpl/default_head.php b/admin/views/layouts/tmpl/default_head.php index bc68bf590..cd2d7c3c6 100644 --- a/admin/views/layouts/tmpl/default_head.php +++ b/admin/views/layouts/tmpl/default_head.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_head.php diff --git a/admin/views/layouts/tmpl/default_toolbar.php b/admin/views/layouts/tmpl/default_toolbar.php index 808cee040..9a431289c 100644 --- a/admin/views/layouts/tmpl/default_toolbar.php +++ b/admin/views/layouts/tmpl/default_toolbar.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index aab8bca8e..a5412c754 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 66 of this MVC - @build 3rd February, 2017 + @version @update number 67 of this MVC + @build 11th February, 2017 @created 18th May, 2015 @package Component Builder @subpackage view.html.php diff --git a/componentbuilder.xml b/componentbuilder.xml index b032c86aa..d6818b5e6 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 11th February, 2017 + 13th February, 2017 Llewellyn van der Merwe joomla@vdm.io http://vdm.bz/component-builder Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.3.2 + 2.3.4 Component Builder (v.2.3.2) +

Component Builder (v.2.3.4)

The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 2721df734..fc9e91eaf 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -611,4 +611,38 @@ http://vdm.bz/component-builder + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.3.3 + http://vdm.bz/component-builder + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.3.4/JCB_v2.3.4.zip + + + stable + + Llewellyn van der Merwe + http://vdm.bz/component-builder + + + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.3.4 + http://vdm.bz/component-builder + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.3.4/JCB_v2.3.4.zip + + + stable + + Llewellyn van der Merwe + http://vdm.bz/component-builder + + \ No newline at end of file diff --git a/script.php b/script.php index 2b8566609..611f572c9 100644 --- a/script.php +++ b/script.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.3.2 - @build 11th February, 2017 + @version 2.3.4 + @build 13th February, 2017 @created 30th April, 2015 @package Component Builder @subpackage script.php @@ -1433,9 +1433,9 @@ class com_componentbuilderInstallerScript $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","code":"code","to_line":"to_line","system_name":"system_name","hashtarget":"hashtarget","hashendtarget":"hashendtarget","from_line":"from_line","not_required":"not_required"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","hashendtarget":"hashendtarget","hashtarget":"hashtarget","function_name":"function_name","system_name":"system_name","to_line":"to_line","code":"code","from_line":"from_line","not_required":"not_required"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $custom_code_Inserted = $db->insertObject('#__content_types', $custom_code); @@ -1748,9 +1748,9 @@ class com_componentbuilderInstallerScript $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","code":"code","to_line":"to_line","system_name":"system_name","hashtarget":"hashtarget","hashendtarget":"hashendtarget","from_line":"from_line","not_required":"not_required"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","hashendtarget":"hashendtarget","hashtarget":"hashtarget","function_name":"function_name","system_name":"system_name","to_line":"to_line","code":"code","from_line":"from_line","not_required":"not_required"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if custom_code type is already in content_type DB. $custom_code_id = null; @@ -1950,7 +1950,7 @@ class com_componentbuilderInstallerScript echo ' -

Upgrade to Version 2.3.2 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.3.4 Was Successful! Let us know if anything is not working as expected.

'; } } }